Make plugin dependencies optional by allowing plugins to report errors

This commit is contained in:
Raphael Michel
2015-04-19 17:35:42 +02:00
parent cd0986606c
commit d17bf6a874
10 changed files with 70 additions and 8 deletions

View File

@@ -20,5 +20,6 @@ def get_all_plugins() -> "List[class]":
if hasattr(app, 'PretixPluginMeta'):
meta = app.PretixPluginMeta
meta.module = app.name
meta.app = app
plugins.append(meta)
return plugins

View File

@@ -39,8 +39,9 @@ class EventPluginSignal(django.dispatch.Signal):
# Only fire receivers from active plugins
if app.name in sender.get_plugins():
response = receiver(signal=self, sender=sender, **named)
responses.append((receiver, response))
if not hasattr(app, 'compatibility_errors') or not app.compatibility_errors:
response = receiver(signal=self, sender=sender, **named)
responses.append((receiver, response))
return responses
"""