Skip to content

Commit

Permalink
nit: replace variable with constant enum in register_cre, code qualit…
Browse files Browse the repository at this point in the history
…y only
  • Loading branch information
northdpole committed Sep 20, 2024
1 parent 9c781e9 commit d41e076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/cmd/cre_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ def register_cre(cre: defs.CRE, collection: db.Node_collection) -> Tuple[db.CRE,
dbcre: db.CRE = collection.add_cre(cre)
for link in cre.links:
if type(link.document) == defs.CRE:
logger.info(f"{link.document.id} {link.ltype} {cre.id}")
other_cre, _ = register_cre(link.document, collection)

# the following flips the PartOf relationship so that we only have contains relationship in the database
if link.ltype == defs.LinkTypes.Contains:
collection.add_internal_link(
higher=dbcre,
lower=other_cre,
type=link.ltype,
type=defs.LinkTypes.Contains,
)
elif link.ltype == defs.LinkTypes.PartOf:
collection.add_internal_link(
Expand Down

0 comments on commit d41e076

Please sign in to comment.