forked from CGM_Public/pretix_original
Moved CORE_MODULES to a setting
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
import pretix.base.i18n
|
import pretix.base.i18n
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import django.dispatch
|
import django.dispatch
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
|
from django.conf import settings
|
||||||
from django.dispatch.dispatcher import NO_RECEIVERS
|
from django.dispatch.dispatcher import NO_RECEIVERS
|
||||||
from typing import Any, Callable, List, Tuple
|
from typing import Any, Callable, List, Tuple
|
||||||
|
|
||||||
from .models import Event
|
from .models import Event
|
||||||
|
|
||||||
CORE_MODULES = {("pretix", "base"), ("pretix", "presale"), ("pretix", "control")}
|
|
||||||
|
|
||||||
|
|
||||||
class EventPluginSignal(django.dispatch.Signal):
|
class EventPluginSignal(django.dispatch.Signal):
|
||||||
"""
|
"""
|
||||||
@@ -42,7 +41,7 @@ class EventPluginSignal(django.dispatch.Signal):
|
|||||||
searchpath, mod = searchpath.rsplit(".", 1)
|
searchpath, mod = searchpath.rsplit(".", 1)
|
||||||
|
|
||||||
# Only fire receivers from active plugins and core modules
|
# Only fire receivers from active plugins and core modules
|
||||||
if (searchpath, mod) in CORE_MODULES or (app and app.name in sender.get_plugins()):
|
if (searchpath, mod) in settings.CORE_MODULES or (app and app.name in sender.get_plugins()):
|
||||||
if not hasattr(app, 'compatibility_errors') or not app.compatibility_errors:
|
if not hasattr(app, 'compatibility_errors') or not app.compatibility_errors:
|
||||||
response = receiver(signal=self, sender=sender, **named)
|
response = receiver(signal=self, sender=sender, **named)
|
||||||
responses.append((receiver, response))
|
responses.append((receiver, response))
|
||||||
|
|||||||
@@ -167,6 +167,12 @@ INSTALLED_APPS = [
|
|||||||
for entry_point in iter_entry_points(group='pretix.plugin', name=None):
|
for entry_point in iter_entry_points(group='pretix.plugin', name=None):
|
||||||
INSTALLED_APPS.append(entry_point.module_name)
|
INSTALLED_APPS.append(entry_point.module_name)
|
||||||
|
|
||||||
|
CORE_MODULES = {
|
||||||
|
("pretix", "base"),
|
||||||
|
("pretix", "presale"),
|
||||||
|
("pretix", "control")
|
||||||
|
}
|
||||||
|
|
||||||
MIDDLEWARE_CLASSES = [
|
MIDDLEWARE_CLASSES = [
|
||||||
'pretix.multidomain.middlewares.MultiDomainMiddleware',
|
'pretix.multidomain.middlewares.MultiDomainMiddleware',
|
||||||
'pretix.multidomain.middlewares.SessionMiddleware',
|
'pretix.multidomain.middlewares.SessionMiddleware',
|
||||||
|
|||||||
Reference in New Issue
Block a user