From b47b2dbac301f33942f8df74a65dac58069eab53 Mon Sep 17 00:00:00 2001 From: Simon Oliver Tveit Date: Thu, 6 Feb 2025 07:54:44 +0100 Subject: [PATCH] Send map widget GET request to info-search view Seemed like the form sent a request to home (/) directly, when it probably should have been sent to /search/ instead. This at least makes it so if you search for a room and it finds a match it opens the page for the room, and if there is no match then it still shows the search page but with the message that nothing was found. If this is how the map widget is supposed to function is uncertain to me, I dont actually know how it originally worked before it broke (if it ever worked) --- changelog.d/3207.fixed.md | 1 + python/nav/web/navlets/room_map.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/3207.fixed.md diff --git a/changelog.d/3207.fixed.md b/changelog.d/3207.fixed.md new file mode 100644 index 0000000000..65345f023d --- /dev/null +++ b/changelog.d/3207.fixed.md @@ -0,0 +1 @@ +Fixed search function for room map widget not working diff --git a/python/nav/web/navlets/room_map.py b/python/nav/web/navlets/room_map.py index 677ed41974..283ab1d068 100644 --- a/python/nav/web/navlets/room_map.py +++ b/python/nav/web/navlets/room_map.py @@ -32,7 +32,7 @@ def get(self, request, *args, **kwargs): context['can_edit_rooms'] = request.account.has_perm( 'web_access', reverse('seeddb-room-edit') ) - context['searchform'] = SearchForm() + context['searchform'] = SearchForm(form_action='info-search') return self.render_to_response(context) def get_template_basename(self):