Skip to content

Commit

Permalink
resuse uri
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Oct 31, 2023
1 parent abcbcc7 commit b5787b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hdmf/common/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,10 @@ def add_ref(self, **kwargs):
# The entity exists and so we need to check if an entity_key exists
# for this entity and key combination.
check_entity_key = True
if entity_uri is not None:
entity = entity.entity_uri
msg = 'This entity already exists. Ignoring new entity uri'
warn(msg)

#################
# Validate Object
Expand Down Expand Up @@ -716,10 +720,6 @@ def add_ref(self, **kwargs):
self._add_object_key(object_field, key)

if check_entity_key:
if entity_uri is not None:
msg = 'This entity already exists. Ignoring new entity uri'
warn(msg)

# check for entity-key relationship in EntityKeyTable
key_idx = key.idx
entity_key_row_idx = self.entity_keys.which(keys_idx=key_idx)
Expand Down

0 comments on commit b5787b8

Please sign in to comment.