Skip to content

Commit 7751e7c

Browse files
committed
Add more comments as reminder
1 parent c40434a commit 7751e7c

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

src/app.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ def get_ancestor_organs(id):
312312
# since public entities don't require user token
313313
token = get_internal_token()
314314

315-
# Query target entity against uuid-api and neo4j and return as a dict if exists
315+
# Get the entity dict from cache if exists
316+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
316317
entity_dict = query_target_entity(id, token)
317318
normalized_entity_type = entity_dict['entity_type']
318319

@@ -488,7 +489,8 @@ def get_entity_provenance(id):
488489
# since public entities don't require user token
489490
token = get_internal_token()
490491

491-
# Query target entity against uuid-api and neo4j and return as a dict if exists
492+
# Get the entity dict from cache if exists
493+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
492494
entity_dict = query_target_entity(id, token)
493495
uuid = entity_dict['uuid']
494496
normalized_entity_type = entity_dict['entity_type']
@@ -707,7 +709,8 @@ def get_collection(id):
707709
# since public collections don't require user token
708710
token = get_internal_token()
709711

710-
# Query target entity against uuid-api and neo4j and return as a dict if exists
712+
# Get the entity dict from cache if exists
713+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
711714
collection_dict = query_target_entity(id, token)
712715

713716
# A bit validation
@@ -1098,7 +1101,8 @@ def update_entity(id):
10981101
normalized_status = schema_manager.normalize_status(json_data_dict["sub_status"])
10991102
json_data_dict["sub_status"] = normalized_status
11001103

1101-
# Get target entity and return as a dict if exists
1104+
# Get the entity dict from cache if exists
1105+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
11021106
entity_dict = query_target_entity(id, user_token)
11031107

11041108
# Normalize user provided entity_type
@@ -1276,8 +1280,8 @@ def get_ancestors(id):
12761280
# since public entities don't require user token
12771281
token = get_internal_token()
12781282

1279-
# Make sure the id exists in uuid-api and
1280-
# the corresponding entity also exists in neo4j
1283+
# Get the entity dict from cache if exists
1284+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
12811285
entity_dict = query_target_entity(id, token)
12821286
normalized_entity_type = entity_dict['entity_type']
12831287
uuid = entity_dict['uuid']
@@ -1370,8 +1374,8 @@ def get_descendants(id):
13701374
# Get user token from Authorization header
13711375
user_token = get_user_token(request)
13721376

1373-
# Make sure the id exists in uuid-api and
1374-
# the corresponding entity also exists in neo4j
1377+
# Get the entity dict from cache if exists
1378+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
13751379
entity_dict = query_target_entity(id, user_token)
13761380
uuid = entity_dict['uuid']
13771381

@@ -1452,8 +1456,8 @@ def get_parents(id):
14521456
# since public entities don't require user token
14531457
token = get_internal_token()
14541458

1455-
# Make sure the id exists in uuid-api and
1456-
# the corresponding entity also exists in neo4j
1459+
# Get the entity dict from cache if exists
1460+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
14571461
entity_dict = query_target_entity(id, token)
14581462
normalized_entity_type = entity_dict['entity_type']
14591463
uuid = entity_dict['uuid']
@@ -1546,8 +1550,8 @@ def get_children(id):
15461550
# Get user token from Authorization header
15471551
user_token = get_user_token(request)
15481552

1549-
# Make sure the id exists in uuid-api and
1550-
# the corresponding entity also exists in neo4j
1553+
# Get the entity dict from cache if exists
1554+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
15511555
entity_dict = query_target_entity(id, user_token)
15521556
uuid = entity_dict['uuid']
15531557

@@ -1618,8 +1622,8 @@ def get_previous_revisions(id):
16181622
# Get user token from Authorization header
16191623
user_token = get_user_token(request)
16201624

1621-
# Make sure the id exists in uuid-api and
1622-
# the corresponding entity also exists in neo4j
1625+
# Get the entity dict from cache if exists
1626+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
16231627
entity_dict = query_target_entity(id, user_token)
16241628
uuid = entity_dict['uuid']
16251629

@@ -1682,8 +1686,8 @@ def get_next_revisions(id):
16821686
# Get user token from Authorization header
16831687
user_token = get_user_token(request)
16841688

1685-
# Make sure the id exists in uuid-api and
1686-
# the corresponding entity also exists in neo4j
1689+
# Get the entity dict from cache if exists
1690+
# Otherwise query against uuid-api and neo4j to get the entity dict if the id exists
16871691
entity_dict = query_target_entity(id, user_token)
16881692
uuid = entity_dict['uuid']
16891693

0 commit comments

Comments
 (0)