Skip to content

Commit 64faf9b

Browse files
authored
Merge pull request #839 from hubmapconsortium/karlburke/LockPubEntitiesFromUpdate
revised error message when entities update is locked out
2 parents bd4b01b + 6d4dc48 commit 64faf9b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/schema/schema_validators.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -925,20 +925,16 @@ def _is_entity_locked_against_update(existing_entity_dict):
925925
entity_type = existing_entity_dict['entity_type']
926926
if entity_type in ['Publication','Dataset']:
927927
if 'status' in existing_entity_dict and existing_entity_dict['status'] == 'Published':
928-
raise schema_errors.LockedEntityUpdateException(f"{entity_type} cannot be modified, due to"
929-
f" status={existing_entity_dict['status']}.")
928+
raise schema_errors.LockedEntityUpdateException(f"Permission denied to change a published/public {entity_type}.")
930929
elif entity_type in ['Donor','Sample']:
931930
if 'data_access_level' in existing_entity_dict and existing_entity_dict['data_access_level'] == 'public':
932-
raise schema_errors.LockedEntityUpdateException(f"{entity_type} cannot be modified, due to"
933-
f" data_access_level={existing_entity_dict['data_access_level']}.")
931+
raise schema_errors.LockedEntityUpdateException(f"Permission denied to change a published/public {entity_type}.")
934932
elif entity_type in ['Collection','Epicollection']:
935933
if 'doi_url' in existing_entity_dict and existing_entity_dict['doi_url']:
936-
raise schema_errors.LockedEntityUpdateException(f"{entity_type} cannot be modified, due to"
937-
f" doi_url={existing_entity_dict['doi_url']}.")
934+
raise schema_errors.LockedEntityUpdateException(f"Permission denied to change a published/public {entity_type}.")
938935
# Probably never get here, since doi_url and registered_doi must be set as a pair.
939936
if 'registered_doi' in existing_entity_dict and existing_entity_dict['registered_doi']:
940-
raise schema_errors.LockedEntityUpdateException(f"{entity_type} cannot be modified, due to"
941-
f" registered_doi={existing_entity_dict['registered_doi']}.")
937+
raise schema_errors.LockedEntityUpdateException(f"Permission denied to change a published/public {entity_type}.")
942938
else:
943939
entity_uuid = existing_entity_dict['uuid']
944940
raise schema_errors.LockedEntityUpdateException(f'Unable to check if {entity_type} for {entity_uuid} is locked!')

0 commit comments

Comments
 (0)