Skip to content

Commit

Permalink
#145: Remove unused code
Browse files Browse the repository at this point in the history
- Recursing through related objects is no longer required
  • Loading branch information
MRichards99 committed Oct 8, 2020
1 parent 85860ff commit be3c797
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions common/icat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,16 +865,13 @@ def create_entities(client, table_name, data):
value = str_to_datetime_object(value)

setattr(new_entity, attribute_name, value)

else:
# This means the attribute has a relationship with another object
log.debug(f"Entity Info: {entity_info}")
try:
related_object = client.get(entity_info.type, value)
except ICATNoObjectError as e:
raise BadRequestError(e)
# TODO - Recurse over related_object and get included entities from
# them
if entity_info.relType.lower() == "many":
related_object = [related_object]
setattr(new_entity, attribute_name, related_object)
Expand Down

0 comments on commit be3c797

Please sign in to comment.