Skip to content

Commit

Permalink
Sorting by name for tags with Ajax widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzejkob committed Oct 29, 2020
1 parent 59709c5 commit 55bba16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion feder/institutions/views.py
Expand Up @@ -123,7 +123,7 @@ def get_queryset(self):
qs = Tag.objects.annotate(institution_count=Count("institution"))
if self.q:
qs = qs.filter(name__icontains=self.q)
return qs.order_by("-institution_count").all()
return qs.order_by("name").all()

def get_result_label(self, result):
return "%s (%d)" % (str(result), result.institution_count)

0 comments on commit 55bba16

Please sign in to comment.