Skip to content
Snippets Groups Projects
Commit 207430ea authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Merge branch 'fix/add-room-import-only-once' into 'main'

Fix: Only add room import button once

See merge request !239
parents b7f29221 cb8403d5
No related branches found
No related tags found
1 merge request!239Fix: Only add room import button once
Pipeline #273910 passed
...@@ -76,10 +76,15 @@ class EventRoomsWidget(TemplateStatusWidget): ...@@ -76,10 +76,15 @@ class EventRoomsWidget(TemplateStatusWidget):
def render_actions(self, context: {}) -> list[dict]: def render_actions(self, context: {}) -> list[dict]:
actions = super().render_actions(context) actions = super().render_actions(context)
# Action has to be added here since it depends on the event for URL building # 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( actions.append(
{ {
"text": _("Import Rooms from CSV"), "text": _("Import Rooms from CSV"),
"url": reverse_lazy("admin:room-import", kwargs={"event_slug": context["event"].slug}), "url": import_room_url,
} }
) )
return actions return actions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment