Skip to content

Commit

Permalink
validation with file name and not mimetype
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 25, 2024
1 parent 833378c commit ff7fd73
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ckanext/dcor_schemas/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,14 @@ def dataset_state(key, data, errors, context):
# for uploading, they also have to use package_revise *after*
# uploading the resources to set the state to "active".
for res in data_dict["resources"]:
if res["mimetype"] in DC_MIME_TYPES:
suffix = "." + res["name"].rsplit(".", 1)[-1]
for mt in DC_MIME_TYPES:
if suffix in DC_MIME_TYPES[mt]:
is_dc = True
break
else:
is_dc = False
if is_dc:
try:
ds = get_dc_instance(res["id"])
with ds, dclab.IntegrityChecker(ds) as ic:
Expand Down

0 comments on commit ff7fd73

Please sign in to comment.