Allow to disable plugins system-wide

This commit is contained in:
Raphael Michel
2018-08-19 15:12:58 +02:00
parent 625ef3da8a
commit 0e1159b01e
4 changed files with 10 additions and 1 deletions

View File

@@ -42,7 +42,8 @@ class EventPluginSignal(django.dispatch.Signal):
searchpath, _ = searchpath.rsplit(".", 1)
# Only fire receivers from active plugins and core modules
if core_module or (sender and app and app.name in sender.get_plugins()):
excluded = settings.PRETIX_PLUGINS_EXCLUDE
if core_module or (sender and app and app.name in sender.get_plugins() and app.name not in excluded):
if not hasattr(app, 'compatibility_errors') or not app.compatibility_errors:
return True
return False