New handling of plugin URLs (#609)

This commit is contained in:
Raphael Michel
2017-08-29 10:01:50 +03:00
committed by GitHub
parent 557a05135e
commit 43b5140754
13 changed files with 83 additions and 37 deletions

View File

@@ -0,0 +1,11 @@
from pretix.presale.utils import _event_view
def plugin_event_urls(urllist, plugin):
for entry in urllist:
if hasattr(entry, 'url_patterns'):
plugin_event_urls(entry.url_patterns, plugin)
elif hasattr(entry, 'callback'):
entry.callback = _event_view(entry.callback, require_plugin=plugin,
require_live=getattr(entry, '_require_live', True))
return urllist