File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -4017,8 +4017,12 @@ def multiple_components():
40174017 validate_token_if_auth_header_exists (request )
40184018 # Get user token from Authorization header
40194019 user_token = get_user_token (request )
4020+ # Create a dictionary as required to use an entity validator. Ignore the
4021+ # options_dict['existing_entity_dict'] support for PUT requests, since this
4022+ # @app.route() only supports POST.
4023+ options_dict = {'http_request' : request }
40204024 try :
4021- schema_validators .validate_application_header_before_entity_create ("Dataset" , request )
4025+ schema_validators .validate_application_header_before_entity_create (options_dict = options_dict )
40224026 except Exception as e :
40234027 bad_request_error (str (e ))
40244028 require_json (request )
Original file line number Diff line number Diff line change 2424
2525Parameters
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"""
3232def 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
5353Parameters
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"""
6060def validate_entity_not_locked_before_update (options_dict ):
6161 if 'existing_entity_dict' in options_dict :
You can’t perform that action at this time.
0 commit comments