Skip to content

Commit

Permalink
Add missing order_by to ensure duplicate values removed from filter (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljcollinsuk authored Oct 29, 2024
1 parent b3e9d91 commit 5f7899f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controlpanel/frontend/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class Meta:

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.filters["chart_name"].extra["choices"] = Tool.objects.values_list(
"chart_name", "chart_name"
).distinct()
self.filters["chart_name"].extra["choices"] = (
Tool.objects.values_list("chart_name", "chart_name").order_by().distinct()
)
self.filters["chart_name"].field.widget.attrs = {"class": "govuk-select"}
self.filters["is_restricted"].field.widget.choices = [
("all", "---------"),
Expand Down

0 comments on commit 5f7899f

Please sign in to comment.