Skip to content

Commit

Permalink
Merge pull request #26 from Police-Data-Accessibility-Project/mc_issu…
Browse files Browse the repository at this point in the history
…e_312_replace_http_status_code_when_source_not_found

⚙️ Adjust status code for data source not found response
  • Loading branch information
maxachis authored Jun 2, 2024
2 parents f1e47c6 + 4e85a2b commit 144d4ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion middleware/data_source_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def data_source_by_id_wrapper(arg, conn: PgConnection) -> Response:
return make_response(data_source_details, 200)

else:
return make_response({"message": "Data source not found."}, 404)
return make_response({"message": "Data source not found."}, 200)


def get_data_sources_for_map_wrapper(conn: PgConnection):
Expand Down
2 changes: 1 addition & 1 deletion tests/middleware/test_data_source_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ def test_data_source_by_id_wrapper_data_not_found(mock_data_source_by_id_query,
mock_data_source_by_id_query.assert_called_with(
data_source_id="SOURCE_UID_1", conn=mock_conn
)
mock_make_response.assert_called_with({"message": "Data source not found."}, 404)
mock_make_response.assert_called_with({"message": "Data source not found."}, 200)

0 comments on commit 144d4ac

Please sign in to comment.