Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #450 from communitiesuk/FS-3660-fix-pdf-download-link
Browse files Browse the repository at this point in the history
FS-3660 do not return 404 if  `all_uploads_documents` is empty
  • Loading branch information
RamuniN authored Oct 24, 2023
2 parents e9b7065 + 226c4f3 commit 41fdcb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions app/blueprints/assessments/models/applicants_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,13 @@ def _ui_component_from_factory(item: dict, application_id: str):
):
if isinstance(answer, list):
try:
if answer[1][2] == "monthYearField":
input_date = answer[1][1][0]
item["answer"][1][1][0] = _convert_to_month_year(
input_date
)
for i, ans in enumerate(answer):
if ans[2] == "monthYearField":
for j, val in enumerate(ans[1]):
input_date = val
item["answer"][i][1][j] = _convert_to_month_year(
input_date
)
except IndexError:
pass
else:
Expand Down
2 changes: 1 addition & 1 deletion app/blueprints/services/data_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def get_all_uploaded_documents_theme_answers(
all_uploaded_documents_theme_answers_endpoint
)

if all_uploaded_documents_theme_answers_response:
if isinstance(all_uploaded_documents_theme_answers_response, list):
return all_uploaded_documents_theme_answers_response
else:
msg = (
Expand Down

0 comments on commit 41fdcb6

Please sign in to comment.