Skip to content

Commit

Permalink
removed redundant propertykey check in validator
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekFurstPitt committed Aug 2, 2024
1 parent 3ae0829 commit 66dc317
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/schema/schema_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,7 @@ def validate_id_not_in_direct_ancestor(property_key, normalized_entity_type, req
if 'uuid' not in existing_data_dict:
raise KeyError("Missing 'uuid' key in 'existing_data_dict' during calling 'validate_id_not_in_direct_ancestor()' validator method.")
entity_uuid = existing_data_dict.get("uuid")
if property_key == 'direct_ancestor_uuid':
ancestors = new_data_dict.get('direct_ancestor_uuid')
elif property_key == 'direct_ancestor_uuids':
ancestors = new_data_dict.get('direct_ancestor_uuids')
ancestors = new_data_dict.get(property_key)
if entity_uuid in ancestors:
raise ValueError(f"Entity uuid may not be included in {property_key}.")

Expand Down

0 comments on commit 66dc317

Please sign in to comment.