Skip to content

Commit

Permalink
nit #147
Browse files Browse the repository at this point in the history
  • Loading branch information
johnatawnclementawn authored and jacobtylerwalls committed Jan 17, 2025
1 parent 722730e commit b8998aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arches_lingo/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ def validate(self, data):
graph_slug, resource_ids=[resource_instance_id]
).get(pk=resource_instance_id)
current_labels = resource_instance.appellative_status

for label in current_labels:
label_language = label.appellative_status_ascribed_name_language[0]
label_type = label.appellative_status_ascribed_relation[0]
if (
data["tileid"] != label.tileid
and new_label_type["uri"] == PREF_LABEL_LIST_ITEM.uri
and label.appellative_status_ascribed_relation[0]["uri"]
== PREF_LABEL_LIST_ITEM.uri
and label.appellative_status_ascribed_name_language[0]["uri"]
== new_label_language["uri"]
and label_type["uri"] == PREF_LABEL_LIST_ITEM.uri
and label_language["uri"] == new_label_language["uri"]
):
raise ValidationError(
"A preferred label with the same language already exists for this scheme."
Expand Down

0 comments on commit b8998aa

Please sign in to comment.