diff --git a/ckanext/unfold/plugin.py b/ckanext/unfold/plugin.py index c9d1058..25aa677 100644 --- a/ckanext/unfold/plugin.py +++ b/ckanext/unfold/plugin.py @@ -51,10 +51,10 @@ def form_template(self, context: Context, data_dict: DataDict) -> str: def before_resource_update( self, context: Context, current: dict[str, Any], resource: dict[str, Any] ) -> None: - if resource["url_type"] == "upload" and not resource["upload"]: + if resource.get("url_type") == "upload" and not resource.get("upload"): return - if resource["url_type"] == "url" and current["url"] == resource["url"]: + if resource.get("url_type") == "url" and current["url"] == resource["url"]: return unf_utils.delete_archive_structure(resource["id"])