Fix #330 -- Add require_live parameter to event_view decorator (#331)

* Add require_live flag to event_view decorator

Refs #330

* Use new require_live flag in stripe webhook
This commit is contained in:
Tobias Kunze
2016-11-25 14:34:49 +01:00
committed by Raphael Michel
parent 9bce339575
commit 7a8493cae3
3 changed files with 22 additions and 16 deletions
+3 -2
View File
@@ -84,13 +84,14 @@ view if you want pretix's default behavior::
from pretix.presale.utils import event_view
@event_view
def event_view(request, *args, **kwargs):
def some_event_view(request, *args, **kwargs):
...
This decorator will check the URL arguments for their ``event`` and ``organizer`` parameters and
correctly ensure that:
* The requested event exists and is activated
* The requested event exists
* The requested event is activated (can be overridden by decorating with ``@event_view(require_live=False)``)
* The event is accessed via the domain it should be accessed
* The ``request.event`` attribute contains the correct ``Event`` object
* The ``request.organizer`` attribute contains the correct ``Organizer`` object