Seat-specific vouchers (#1486)

* Basic functionality

* API

* Do not delete seats with vouchers

* Show seat in list of seats

* Validate availability of seats

* Fix invalid logic in Seat.is_available

* Show voucher name in edit form
This commit is contained in:
Raphael Michel
2019-11-15 10:56:34 +01:00
committed by GitHub
parent f79df47b78
commit a2c1c69d7e
19 changed files with 474 additions and 42 deletions

View File

@@ -45,7 +45,7 @@ class VoucherViewSet(viewsets.ModelViewSet):
write_permission = 'can_change_vouchers'
def get_queryset(self):
return self.request.event.vouchers.all()
return self.request.event.vouchers.select_related('seat').all()
def _predict_quota_check(self, data, instance):
# This method predicts if Voucher.clean_quota_needs_checking