Event dashboard with a flat design and plugin hooks

This commit is contained in:
Raphael Michel
2016-02-22 16:14:01 +01:00
parent 0fd519df4d
commit 4f35a16787
8 changed files with 171 additions and 119 deletions

View File

@@ -5,6 +5,8 @@ from typing import Any, Callable, List, Tuple
from .models import Event
CORE_MODULES = {("pretix", "base"), ("pretix", "presale"), ("pretix", "control")}
class EventPluginSignal(django.dispatch.Signal):
"""
@@ -40,7 +42,7 @@ class EventPluginSignal(django.dispatch.Signal):
searchpath, mod = searchpath.rsplit(".", 1)
# Only fire receivers from active plugins and core modules
if (searchpath, mod) == ("pretix", "base") or (app and app.name in sender.get_plugins()):
if (searchpath, mod) in CORE_MODULES or (app and app.name in sender.get_plugins()):
if not hasattr(app, 'compatibility_errors') or not app.compatibility_errors:
response = receiver(signal=self, sender=sender, **named)
responses.append((receiver, response))