Skip to content

Commit

Permalink
Merge pull request #52 from cf15-t5/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
lutfianRhdn authored Aug 25, 2023
2 parents 2fff501 + 14ac241 commit dd487fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/TicketService.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def attendTicket(self,data,user_id):
ticket = ticketRepository.getTicketByCode(data['ticket_code'])
if(not ticket):
return self.failedOrSuccessRequest('failed', 400, 'ticket not found')
if(ticket.user_id != user_id):
if(ticket.event.user_id != user_id):
return self.failedOrSuccessRequest('failed', 400, 'ticket not belong to you')
if(ticket.is_attended):
return self.failedOrSuccessRequest('failed', 400, 'ticket already attended')
Expand All @@ -132,4 +132,4 @@ def attendTicket(self,data,user_id):
except ValueError as e:
return self.failedOrSuccessRequest('failed', 400, errorHandler(e.errors()))
except Exception as e:
return self.failedOrSuccessRequest('failed', 500, str(e))
return self.failedOrSuccessRequest('failed', 500, str(e))

0 comments on commit dd487fd

Please sign in to comment.