Skip to content

Commit

Permalink
Merge pull request #133 from opendata-swiss/fix_existing_pkg_keys
Browse files Browse the repository at this point in the history
Clear the value in existing_pkg if it not in the dataset_dict
  • Loading branch information
kovalch authored Sep 30, 2024
2 parents d5f1f05 + a915ec0 commit 5be4a53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ckanext/geocat/utils/harvest_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def create_activity(package_id, message):


def check_package_change(existing_pkg, dataset_dict):
# Ensure to clear the key values if they are not
# in the new dataset_dict
for key in existing_pkg.keys():
if key not in dataset_dict or not dataset_dict[key]:
existing_pkg[key] = ''
if _changes_in_date(
existing_pkg.get('modified'), dataset_dict.get('modified')):
msg = "dataset modified date changed: {}" \
Expand Down

0 comments on commit 5be4a53

Please sign in to comment.