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