Skip to content

Commit

Permalink
fix: move cancelled applications to archive page (#3079) (HL-1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiliaMakelaVincit committed Jun 11, 2024
1 parent 1f1c84a commit 9e0c05d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/benefit/applications/api/v1/application_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ def _get_archived_for_applicant(self, queryset, name, value: bool):
"batch__decision_date__lte": archive_threshold.isoformat(),
}

query = Q(**query) | Q(status=ApplicationStatus.CANCELLED)

if value:
return queryset.filter(**query)
return queryset.filter(query)
else:
return queryset.filter(~Q(**query))
return queryset.filter(~query)


class ApplicantApplicationFilter(BaseApplicationFilter):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,9 @@ def get_archived_for_applicant(self, application):
Make sure any changes here are reflected in the filter set as well.
"""

if application.status == ApplicationStatus.CANCELLED:
return True

if application.batch is None:
return False

Expand Down

0 comments on commit 9e0c05d

Please sign in to comment.