Skip to content

Commit

Permalink
Fix issue with age group filter in application section admin
Browse files Browse the repository at this point in the history
  • Loading branch information
matti-lamppu committed Sep 5, 2024
1 parent f504579 commit 28c968b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions applications/admin/application_section/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class AgeGroupFilter(admin.SimpleListFilter):
def lookups(self, request: WSGIRequest, model_admin: ApplicationSectionAdmin) -> list[tuple[str, str]]:
return AgeGroup.objects.annotate(
repr=models.Case(
models.When(maximum=None, then=Concat("minimum", models.Value("+"))),
default=Concat("minimum", models.Value(" - "), "maximum"),
models.When(maximum=None, then=Concat("minimum", models.Value("+"), output_field=models.CharField())),
default=Concat("minimum", models.Value(" - "), "maximum", output_field=models.CharField()),
output_field=models.CharField(),
),
).values_list("id", "repr")
Expand Down

0 comments on commit 28c968b

Please sign in to comment.