Skip to content

Commit 2c7f947

Browse files
authored
Merge pull request #848 from hubmapconsortium/karlburke/PUTCall500ExceptionRevertingDatasetStatus
Add module resolution to Exception subclass usage.
2 parents 7644e91 + 45ad301 commit 2c7f947

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/schema/schema_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class SchemaConstants(object):
66
ENTITY_API_APP = 'entity-api'
77
COMPONENT_DATASET = 'component-dataset'
88
INGEST_PIPELINE_APP = 'ingest-pipeline'
9+
INGEST_UI = 'ingest-ui'
910
HUBMAP_APP_HEADER = 'X-Hubmap-Application'
1011
LOCKED_ENTITY_UPDATE_HEADER = 'X-HuBMAP-Update-Override'
1112
INTERNAL_TRIGGER = 'X-Internal-Trigger'

src/schema/schema_validators.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def validate_application_header_before_entity_create(options_dict):
4141
applications_allowed = [
4242
SchemaConstants.INGEST_API_APP,
4343
SchemaConstants.INGEST_PIPELINE_APP,
44+
SchemaConstants.INGEST_UI,
4445
SchemaConstants.ENTITY_API_APP
4546
]
4647

@@ -348,6 +349,7 @@ def validate_application_header_before_property_update(property_key, normalized_
348349
applications_allowed = [
349350
SchemaConstants.INGEST_API_APP,
350351
SchemaConstants.INGEST_PIPELINE_APP,
352+
SchemaConstants.INGEST_UI,
351353
SchemaConstants.ENTITY_API_APP
352354
]
353355

@@ -906,12 +908,12 @@ def _validate_application_header(applications_allowed, request_headers):
906908

907909
if not app_header:
908910
msg = f"Unable to proceed due to missing {SchemaConstants.HUBMAP_APP_HEADER} header from request"
909-
raise MissingApplicationHeaderException(msg)
911+
raise schema_errors.MissingApplicationHeaderException(msg)
910912

911913
# Use lowercase for comparing the application header value against the yaml
912914
if app_header.lower() not in applications_allowed:
913915
msg = f"Unable to proceed due to invalid {SchemaConstants.HUBMAP_APP_HEADER} header value: {app_header}"
914-
raise InvalidApplicationHeaderException(msg)
916+
raise schema_errors.InvalidApplicationHeaderException(msg)
915917

916918
"""
917919
Indicate if the entity meets a criteria to lock out modification updates

0 commit comments

Comments
 (0)