diff --git a/AKModel/views/status.py b/AKModel/views/status.py index e14ce2fbbcc7c662f71d1711a6fa14b372fb3595..233d4cc9be571db5b4a1ee31a607d1fa04b9305e 100644 --- a/AKModel/views/status.py +++ b/AKModel/views/status.py @@ -76,10 +76,15 @@ class EventRoomsWidget(TemplateStatusWidget): def render_actions(self, context: {}) -> list[dict]: actions = super().render_actions(context) # Action has to be added here since it depends on the event for URL building + import_room_url = reverse_lazy("admin:room-import", kwargs={"event_slug": context["event"].slug}) + for action in actions: + if action["url"] == import_room_url: + return actions + actions.append( { "text": _("Import Rooms from CSV"), - "url": reverse_lazy("admin:room-import", kwargs={"event_slug": context["event"].slug}), + "url": import_room_url, } ) return actions