Skip to content

Commit

Permalink
Fix hvd_category duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanez authored Nov 6, 2024
1 parent e940fa2 commit 08241ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ckanext/schemingdcat/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,10 @@ def validator(key, data, errors, context):
hvd_category = data.get(('hvd_category', ))
if hvd_category:
if isinstance(data.get(key), list):
if not data[key]:
data[key] = [DCAT_AP_HVD_CATEGORY_LEGISLATION]
else:
if DCAT_AP_HVD_CATEGORY_LEGISLATION not in data[key]:
data[key].append(DCAT_AP_HVD_CATEGORY_LEGISLATION)
else:
data[key] = [DCAT_AP_HVD_CATEGORY_LEGISLATION]
if data.get(key) != DCAT_AP_HVD_CATEGORY_LEGISLATION:
data[key] = [DCAT_AP_HVD_CATEGORY_LEGISLATION]

return validator

0 comments on commit 08241ef

Please sign in to comment.