Skip to content

Commit

Permalink
refactor: use get for accessing res fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Sep 5, 2023
1 parent 001c152 commit 044ac78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckanext/unfold/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit 044ac78

Please sign in to comment.