Skip to content

Commit

Permalink
fix: Set landing page empty if it now in new dict
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Nov 19, 2024
1 parent 5c11f1b commit 2bd0feb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ckanext/geocat/harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,25 @@ def import_stage(self, harvest_object): # noqa
context['schema'] = schema
schema['__junk'] = [ignore]
pkg_dict['name'] = pkg_info.name

pkg_dict['id'] = pkg_info.package_id

existing_package = map_resources_to_ids(
pkg_dict,
pkg_info.package_id
)

# Ensure 'url' is set to "" if it's not in pkg_dict
existing_url = existing_package.get("url")
new_url = pkg_dict.get("url")
if new_url is None and new_url != existing_url:
existing_package["url"] = ""

package_changed, msg = check_package_change(
existing_package,
pkg_dict
)

if package_changed:
create_activity(package_id=pkg_dict['id'], message=msg)
updated_pkg = \
Expand Down

0 comments on commit 2bd0feb

Please sign in to comment.