Skip to content

Commit

Permalink
NRL-567 Ignore errors for first part of ID not mathcing custodian for…
Browse files Browse the repository at this point in the history
… 64 chars IDs, REF special case
  • Loading branch information
axelkrastek1-nhs committed Sep 26, 2024
1 parent 4edc5c8 commit c18ad8c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,13 @@ def handler(
ods_code_parts=metadata.ods_code_parts,
producer_id=core_model.producer_id,
)
return SpineErrorResponse.BAD_REQUEST(
diagnostics="The id of the provided DocumentReference does not include the expected ODS code for this organisation"
)

# REF IDs will be exactly 64 chars long with truncated ODS codes
# truncated ODS codes are only expected for REF so only ignore those.
if len(core_model.producer_id) != 64:
return SpineErrorResponse.BAD_REQUEST(
diagnostics="The id of the provided DocumentReference does not include the expected ODS code for this organisation"
)

if error_response := _check_permissions(core_model, metadata):
return error_response
Expand Down

0 comments on commit c18ad8c

Please sign in to comment.