Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#45 | not validating retired concept locales
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Aug 5, 2021
1 parent 90745d7 commit 8c1be68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/concepts/custom_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def __init__(self, **kwargs):
self.reference_values = kwargs.pop('reference_values')

def validate_concept_based(self, concept):
if concept.retired:
return
self.must_have_exactly_one_preferred_name(concept)
self.all_non_short_names_must_be_unique(concept)
self.no_more_than_one_short_name_per_locale(concept)
Expand All @@ -30,6 +32,8 @@ def validate_concept_based(self, concept):
self.lookup_attributes_should_be_valid(concept)

def validate_source_based(self, concept):
if concept.retired:
return
self.fully_specified_name_should_be_unique_for_source_and_locale(concept)
self.preferred_name_should_be_unique_for_source_and_locale(concept)

Expand Down
2 changes: 2 additions & 0 deletions core/concepts/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def validate_source_based(self, concept):

class BasicConceptValidator(BaseConceptValidator):
def validate_concept_based(self, concept):
if concept.retired:
return
self.description_cannot_be_null(concept)
self.must_have_at_least_one_name(concept)

Expand Down

0 comments on commit 8c1be68

Please sign in to comment.