Skip to content

Commit

Permalink
Also cancel order
Browse files Browse the repository at this point in the history
  • Loading branch information
ezkat committed Oct 19, 2023
1 parent 058c246 commit 0c488f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion resources/models/reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def catering_orders_visible(self, user):
def cancel(self, user):
for reservation in self:
reservation.set_state(Reservation.CANCELLED, user)

if reservation.has_order():
order = reservation.get_order()
order.set_state('cancelled', 'Order reservation was cancelled.')

Check warning on line 96 in resources/models/reservation.py

View check run for this annotation

Codecov / codecov/patch

resources/models/reservation.py#L95-L96

Added lines #L95 - L96 were not covered by tests
class ReservationBulkQuerySet(models.QuerySet):
def current(self):
return self
Expand Down

0 comments on commit 0c488f5

Please sign in to comment.