pretalx-musicrate/pretalx_musicrate/signals.py

23 lines
651 B
Python
Raw Normal View History

2023-12-13 23:58:00 +01:00
from django.dispatch import receiver
from django.urls import reverse
from pretalx.orga.signals import nav_event_settings
@receiver(nav_event_settings)
def pretalx_musicrate_settings(sender, request, **kwargs):
if not request.user.has_perm("orga.change_settings", request.event):
return []
return [
{
"label": "pretalx musicrate plugin",
"url": reverse(
"plugins:pretalx_musicrate:settings",
kwargs={"event": request.event.slug},
),
"active": request.resolver_match.url_name
== "plugins:pretalx_musicrate:settings",
}
]