Skip to content

Commit

Permalink
Merge pull request #2595 from johannaengland/bugfix/room-search-relat…
Browse files Browse the repository at this point in the history
…ed-names

Fix backwards relation references in room search
  • Loading branch information
johannaengland committed May 25, 2023
2 parents 4672022 + 50de7f0 commit b7f24ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/nav/web/info/room/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def search(request):
titles.append(("Search for %s" % request.GET['query'],))
rooms = process_searchform(searchform)
for room in rooms:
room.netboxes = filter_netboxes(room)
room.filtered_netboxes = filter_netboxes(room)
else:
searchform = RoomSearchForm()

Expand All @@ -111,7 +111,7 @@ def process_searchform(form):
return Room.objects.filter(
Q(id__icontains=query)
| Q(description__icontains=query)
| Q(child_locations__id__icontains=query)
| Q(location__id__icontains=query)
).order_by("id")


Expand Down
2 changes: 1 addition & 1 deletion python/nav/web/templates/info/room/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3>Room search</h3>
{{ room.description }}
</td>
<td>
{{ room.netboxes.count }}
{{ room.filtered_netboxes.count }}
</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit b7f24ec

Please sign in to comment.