Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#45 | OpenMRS collection concepts validation…
Browse files Browse the repository at this point in the history
… to consider same name types
  • Loading branch information
snyaggarwal committed Dec 21, 2021
1 parent f64015b commit 292c7c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/collections/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ def check_concept_uniqueness_in_collection_and_locale_by_name_attribute(
raise ValidationError(validation_error)

matching_names_in_concept[name_key] = True
if other_concepts_in_collection.filter(names__name=name.name, names__locale=name.locale).exists():
if other_concepts_in_collection.filter(
names__name=name.name, names__locale=name.locale, **{"names__{}".format(attribute): value}
).exists():
raise ValidationError(validation_error)

@staticmethod
Expand Down

0 comments on commit 292c7c9

Please sign in to comment.