Respect per-event plugin availability in OrganizerPluginEvents view (#5983)

* Allow plugins to declare their availability per event

* Fix message type

* small optimization of PluginsField serializer
This commit is contained in:
luelista
2026-05-04 11:34:05 +02:00
committed by GitHub
parent 0acaed41be
commit 27183a26ee
3 changed files with 47 additions and 46 deletions

View File

@@ -115,10 +115,10 @@ class PluginsField(serializers.Field):
def to_representation(self, obj):
from pretix.base.plugins import get_all_plugins
active_plugins = set(obj.get_plugins())
return sorted([
p.module for p in get_all_plugins()
if not p.name.startswith('.') and getattr(p, 'visible', True) and p.module in obj.get_plugins()
if not p.name.startswith('.') and getattr(p, 'visible', True) and p.module in active_plugins
])
def to_internal_value(self, data):