Skip to content

Commit 8300e0e

Browse files
committed
Fire drill fix for entity-level validator call
1 parent 9f70e92 commit 8300e0e

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4005,8 +4005,12 @@ def multiple_components():
40054005
validate_token_if_auth_header_exists(request)
40064006
# Get user token from Authorization header
40074007
user_token = get_user_token(request)
4008+
# Create a dictionary as required to use an entity validator. Ignore the
4009+
# options_dict['existing_entity_dict'] support for PUT requests, since this
4010+
# @app.route() only supports POST.
4011+
options_dict = {'http_request': request}
40084012
try:
4009-
schema_validators.validate_application_header_before_entity_create("Dataset", request)
4013+
schema_validators.validate_application_header_before_entity_create(options_dict=options_dict)
40104014
except Exception as e:
40114015
bad_request_error(str(e))
40124016
require_json(request)

src/schema/schema_validators.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
2525
Parameters
2626
----------
27-
normalized_type : str
28-
One of the types defined in the schema yaml: Dataset, Upload
29-
request: Flask request
30-
The instance of Flask request passed in from application request
27+
options_dict : dict
28+
A dictionary of data needed by this entity-level validator based upon the create/POST or
29+
update/PUT actions. The dictionary will always have 'http_request' and will have
30+
'existing_entity_dict' for a PUT request.
3131
"""
3232
def validate_application_header_before_entity_create(options_dict):
3333
if 'http_request' in options_dict:
@@ -52,10 +52,10 @@ def validate_application_header_before_entity_create(options_dict):
5252
5353
Parameters
5454
----------
55-
normalized_type : str
56-
One of the types defined in the schema yaml: Dataset, Upload
57-
request: Flask request
58-
The instance of Flask request passed in from application request
55+
options_dict : dict
56+
A dictionary of data needed by this entity-level validator based upon the create/POST or
57+
update/PUT actions. The dictionary will always have 'http_request' and will have
58+
'existing_entity_dict' for a PUT request.
5959
"""
6060
def validate_entity_not_locked_before_update(options_dict):
6161
if 'existing_entity_dict' in options_dict:

0 commit comments

Comments
 (0)