mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Add organizer scope when getting all plugins
This commit is contained in:
@@ -29,6 +29,7 @@ from django.apps import AppConfig, apps
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
from django_scopes import scope
|
||||||
from packaging.requirements import Requirement
|
from packaging.requirements import Requirement
|
||||||
|
|
||||||
PLUGIN_LEVEL_EVENT = 'event'
|
PLUGIN_LEVEL_EVENT = 'event'
|
||||||
@@ -71,7 +72,8 @@ def get_all_plugins(*, event=None, organizer=None) -> List[type]:
|
|||||||
continue
|
continue
|
||||||
elif organizer and hasattr(app, 'is_available'):
|
elif organizer and hasattr(app, 'is_available'):
|
||||||
if not event_fallback_used:
|
if not event_fallback_used:
|
||||||
event_fallback = organizer.events.first()
|
with scope(organizer=organizer):
|
||||||
|
event_fallback = organizer.events.first()
|
||||||
event_fallback_used = True
|
event_fallback_used = True
|
||||||
if not event_fallback or not app.is_available(event_fallback):
|
if not event_fallback or not app.is_available(event_fallback):
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user