@@ -1204,7 +1204,7 @@ def create_entity(entity_type):
12041204 # For Dataset: link to direct ancestors
12051205 # For Collection: link to member Datasets
12061206 # For Upload: link to parent Lab node
1207- after_create (normalized_entity_type , request , user_token , merged_dict )
1207+ after_create (normalized_entity_type , request , user_token , merged_dict , json_data_dict )
12081208
12091209 # By default we'll return all the properties but skip these time-consuming ones
12101210 # Donor doesn't need to skip any
@@ -1451,12 +1451,12 @@ def update_entity(id):
14511451 if direct_ancestor_dict ['entity_type' ] not in ['Donor' , 'Sample' ]:
14521452 bad_request_error (f"The uuid: { direct_ancestor_uuid } is not a Donor neither a Sample, cannot be used as the direct ancestor of this Sample" )
14531453
1454- # Generate 'before_update_triiger ' data and update the entity details in Neo4j
1454+ # Generate 'before_update_trigger ' data and update the entity details in Neo4j
14551455 merged_updated_dict = update_entity_details (request , normalized_entity_type , user_token , json_data_dict , entity_dict )
14561456
14571457 # Handle linkages update via `after_update_trigger` methods
14581458 if has_direct_ancestor_uuid :
1459- after_update (normalized_entity_type , request , user_token , merged_updated_dict )
1459+ after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict )
14601460 # 2/17/23 - Adding direct ancestor checks to publication as well as dataset.
14611461 elif normalized_entity_type in ['Dataset' , 'Publication' ]:
14621462 # A bit more validation if `direct_ancestor_uuids` provided
@@ -1485,7 +1485,7 @@ def update_entity(id):
14851485
14861486 # Handle linkages update via `after_update_trigger` methods
14871487 if has_direct_ancestor_uuids or has_associated_collection_uuid or has_updated_status :
1488- after_update (normalized_entity_type , request , user_token , merged_updated_dict )
1488+ after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict )
14891489 elif normalized_entity_type == 'Upload' :
14901490 has_dataset_uuids_to_link = False
14911491 if ('dataset_uuids_to_link' in json_data_dict ) and (json_data_dict ['dataset_uuids_to_link' ]):
@@ -1500,13 +1500,13 @@ def update_entity(id):
15001500
15011501 # Handle linkages update via `after_update_trigger` methods
15021502 if has_dataset_uuids_to_link or has_dataset_uuids_to_unlink or has_updated_status :
1503- after_update (normalized_entity_type , request , user_token , merged_updated_dict )
1503+ after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict )
15041504 elif schema_manager .entity_type_instanceof (normalized_entity_type , 'Collection' ):
15051505 # Generate 'before_update_trigger' data and update the entity details in Neo4j
15061506 merged_updated_dict = update_entity_details (request , normalized_entity_type , user_token , json_data_dict , entity_dict )
15071507
15081508 # Handle linkages update via `after_update_trigger` methods
1509- after_update (normalized_entity_type , request , user_token , merged_updated_dict )
1509+ after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict )
15101510 else :
15111511 # Generate 'before_update_trigger' data and update the entity details in Neo4j
15121512 merged_updated_dict = update_entity_details (request , normalized_entity_type , user_token , json_data_dict , entity_dict )
@@ -4580,7 +4580,7 @@ def _get_dataset_associated_metadata(dataset_dict, dataset_visibility, valid_use
45804580
45814581
45824582"""
4583- Generate 'before_create_triiger ' data and create the entity details in Neo4j
4583+ Generate 'before_create_trigger ' data and create the entity details in Neo4j
45844584
45854585Parameters
45864586----------
@@ -5000,7 +5000,7 @@ def create_multiple_component_details(request, normalized_entity_type, user_toke
50005000
50015001
50025002"""
5003- Execute 'after_create_triiger ' methods
5003+ Execute 'after_create_trigger ' methods
50045004
50055005Parameters
50065006----------
@@ -5013,8 +5013,10 @@ def create_multiple_component_details(request, normalized_entity_type, user_toke
50135013merged_data_dict: dict
50145014 The merged dict that contains the entity dict newly created and
50155015 information from user request json that are not stored in Neo4j
5016+ json_data_dict: dict
5017+ The json request dict
50165018"""
5017- def after_create (normalized_entity_type , request , user_token , merged_data_dict ):
5019+ def after_create (normalized_entity_type , request , user_token , merged_data_dict , json_data_dict ):
50185020 try :
50195021 # 'after_create_trigger' and 'after_update_trigger' don't generate property values
50205022 # It just returns the empty dict, no need to assign value
@@ -5024,7 +5026,7 @@ def after_create(normalized_entity_type, request, user_token, merged_data_dict):
50245026 , request = request
50255027 , user_token = user_token
50265028 , existing_data_dict = merged_data_dict
5027- , new_data_dict = {} )
5029+ , new_data_dict = json_data_dict )
50285030 except schema_errors .AfterCreateTriggerException :
50295031 # Log the full stack trace, prepend a line with our message
50305032 msg = "The entity has been created, but failed to execute one of the 'after_create_trigger' methods"
@@ -5036,7 +5038,7 @@ def after_create(normalized_entity_type, request, user_token, merged_data_dict):
50365038
50375039
50385040"""
5039- Generate 'before_create_triiger ' data and create the entity details in Neo4j
5041+ Generate 'before_create_trigger ' data and create the entity details in Neo4j
50405042
50415043Parameters
50425044----------
@@ -5133,20 +5135,19 @@ def update_entity_details(request, normalized_entity_type, user_token, json_data
51335135 The instance of Flask request passed in from application request
51345136user_token: str
51355137 The user's globus groups token
5136- entity_dict: dict
5137- The entity dict newly updated
5138+ merged_updated_dict: dict
5139+ The merged entity dict containing newly updated values and existing values
5140+ json_data_dict: dict
5141+ The data dict containing new values
51385142"""
5139- def after_update (normalized_entity_type , request , user_token , entity_dict ):
5143+ def after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict ):
51405144 try :
5141- # 'after_create_trigger' and 'after_update_trigger' don't generate property values
5142- # It just returns the empty dict, no need to assign value
5143- # Use {} sicne no new dict
51445145 schema_manager .generate_triggered_data ( trigger_type = TriggerTypeEnum .AFTER_UPDATE
51455146 , normalized_class = normalized_entity_type
51465147 , request = request
51475148 , user_token = user_token
5148- , existing_data_dict = entity_dict
5149- , new_data_dict = {} )
5149+ , existing_data_dict = merged_updated_dict
5150+ , new_data_dict = json_data_dict )
51505151 except schema_errors .AfterUpdateTriggerException :
51515152 # Log the full stack trace, prepend a line with our message
51525153 msg = "The entity information has been updated, but failed to execute one of the 'after_update_trigger' methods"
0 commit comments