Skip to content

Commit

Permalink
reg: catch case where new resource does not have id
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 25, 2024
1 parent 5260657 commit 0f2ed6b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ckanext/dcor_schemas/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ def package_update(context, data_dict=None):
continue

# Find the resource in the current dataset.
for res in resources_exist:
if res["id"] == new_res["id"]:
cur_res = res
break
else:
cur_res = None
cur_res = None
if "id" in new_res:
for res in resources_exist:
if res["id"] == new_res["id"]:
cur_res = res
break

# Note that on DCOR, you are not allowed to specify the ID
# during upload, unless the resource was already uploaded to S3.
Expand Down

0 comments on commit 0f2ed6b

Please sign in to comment.