@@ -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
@@ -1482,10 +1482,15 @@ def update_entity(id):
14821482
14831483 # Generate 'before_update_trigger' data and update the entity details in Neo4j
14841484 merged_updated_dict = update_entity_details (request , normalized_entity_type , user_token , json_data_dict , entity_dict )
1485+
1486+ print ("==========DEBUG Begin" )
1487+ print (merged_updated_dict )
1488+ print ("==========DEBUG End" )
1489+
14851490
14861491 # Handle linkages update via `after_update_trigger` methods
14871492 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 )
1493+ after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict )
14891494 elif normalized_entity_type == 'Upload' :
14901495 has_dataset_uuids_to_link = False
14911496 if ('dataset_uuids_to_link' in json_data_dict ) and (json_data_dict ['dataset_uuids_to_link' ]):
@@ -1500,13 +1505,13 @@ def update_entity(id):
15001505
15011506 # Handle linkages update via `after_update_trigger` methods
15021507 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 )
1508+ after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict )
15041509 elif schema_manager .entity_type_instanceof (normalized_entity_type , 'Collection' ):
15051510 # Generate 'before_update_trigger' data and update the entity details in Neo4j
15061511 merged_updated_dict = update_entity_details (request , normalized_entity_type , user_token , json_data_dict , entity_dict )
15071512
15081513 # Handle linkages update via `after_update_trigger` methods
1509- after_update (normalized_entity_type , request , user_token , merged_updated_dict )
1514+ after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict )
15101515 else :
15111516 # Generate 'before_update_trigger' data and update the entity details in Neo4j
15121517 merged_updated_dict = update_entity_details (request , normalized_entity_type , user_token , json_data_dict , entity_dict )
@@ -4580,7 +4585,7 @@ def _get_dataset_associated_metadata(dataset_dict, dataset_visibility, valid_use
45804585
45814586
45824587"""
4583- Generate 'before_create_triiger ' data and create the entity details in Neo4j
4588+ Generate 'before_create_trigger ' data and create the entity details in Neo4j
45844589
45854590Parameters
45864591----------
@@ -5000,7 +5005,7 @@ def create_multiple_component_details(request, normalized_entity_type, user_toke
50005005
50015006
50025007"""
5003- Execute 'after_create_triiger ' methods
5008+ Execute 'after_create_trigger ' methods
50045009
50055010Parameters
50065011----------
@@ -5013,8 +5018,10 @@ def create_multiple_component_details(request, normalized_entity_type, user_toke
50135018merged_data_dict: dict
50145019 The merged dict that contains the entity dict newly created and
50155020 information from user request json that are not stored in Neo4j
5021+ json_data_dict: dict
5022+ The json request dict
50165023"""
5017- def after_create (normalized_entity_type , request , user_token , merged_data_dict ):
5024+ def after_create (normalized_entity_type , request , user_token , merged_data_dict , json_data_dict ):
50185025 try :
50195026 # 'after_create_trigger' and 'after_update_trigger' don't generate property values
50205027 # It just returns the empty dict, no need to assign value
@@ -5024,7 +5031,7 @@ def after_create(normalized_entity_type, request, user_token, merged_data_dict):
50245031 , request = request
50255032 , user_token = user_token
50265033 , existing_data_dict = merged_data_dict
5027- , new_data_dict = {} )
5034+ , new_data_dict = json_data_dict )
50285035 except schema_errors .AfterCreateTriggerException :
50295036 # Log the full stack trace, prepend a line with our message
50305037 msg = "The entity has been created, but failed to execute one of the 'after_create_trigger' methods"
@@ -5036,7 +5043,7 @@ def after_create(normalized_entity_type, request, user_token, merged_data_dict):
50365043
50375044
50385045"""
5039- Generate 'before_create_triiger ' data and create the entity details in Neo4j
5046+ Generate 'before_create_trigger ' data and create the entity details in Neo4j
50405047
50415048Parameters
50425049----------
@@ -5133,20 +5140,19 @@ def update_entity_details(request, normalized_entity_type, user_token, json_data
51335140 The instance of Flask request passed in from application request
51345141user_token: str
51355142 The user's globus groups token
5136- entity_dict: dict
5137- The entity dict newly updated
5143+ merged_updated_dict: dict
5144+ The merged entity dict containing newly updated values and existing values
5145+ json_data_dict: dict
5146+ The data dict containing new values
51385147"""
5139- def after_update (normalized_entity_type , request , user_token , entity_dict ):
5148+ def after_update (normalized_entity_type , request , user_token , merged_updated_dict , json_data_dict ):
51405149 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
51445150 schema_manager .generate_triggered_data ( trigger_type = TriggerTypeEnum .AFTER_UPDATE
51455151 , normalized_class = normalized_entity_type
51465152 , request = request
51475153 , user_token = user_token
5148- , existing_data_dict = entity_dict
5149- , new_data_dict = {} )
5154+ , existing_data_dict = merged_updated_dict
5155+ , new_data_dict = json_data_dict )
51505156 except schema_errors .AfterUpdateTriggerException :
51515157 # Log the full stack trace, prepend a line with our message
51525158 msg = "The entity information has been updated, but failed to execute one of the 'after_update_trigger' methods"
0 commit comments