mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Allow to disable plugins system-wide
This commit is contained in:
@@ -2,6 +2,7 @@ from enum import Enum
|
||||
from typing import List
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class PluginType(Enum):
|
||||
@@ -26,5 +27,7 @@ def get_all_plugins() -> List[type]:
|
||||
meta = app.PretixPluginMeta
|
||||
meta.module = app.name
|
||||
meta.app = app
|
||||
if app.name in settings.PRETIX_PLUGINS_EXCLUDE:
|
||||
continue
|
||||
plugins.append(meta)
|
||||
return plugins
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user