Skip to content

Commit

Permalink
Merge pull request #253 from dpc-sdp/SXDEDPCXZIC-402
Browse files Browse the repository at this point in the history
SXDEDPCXZIC-402 / change logo file formats to upload
  • Loading branch information
iaroslav13 authored Dec 10, 2024
2 parents 01e1c4b + fd0e182 commit 55b4229
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckanext/datavic_odp_theme/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def datavic_update_org_error_dict(
error_dict["Logo"] = [(
"Image format is not supported. "
"Select an image in one of the following formats: "
"JPG, JPEG, GIF, PNG, BMP, SVG."
"JPG, JPEG, GIF, PNG, WEBP."
)]

return error_dict
Expand Down
4 changes: 2 additions & 2 deletions ckanext/datavic_odp_theme/logic/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def datavic_organization_upload(key, data, errors, context):
(
"Image format is not supported. "
"Select an image in one of the following formats: "
"JPG, JPEG, GIF, PNG, BMP, SVG."
"JPG, JPEG, GIF, PNG, WEBP."
)
)


def _is_valid_image_extension(mimetype: str) -> bool:
"""Check if the mimetype corresponds to a valid image extension."""
valid_extensions = ["jpg", "png", "jpeg", "gif", "bmp", "svg"]
valid_extensions = ["jpg", "png", "jpeg", "gif", "webp"]
extension = mimetypes.guess_extension(mimetype)
return extension and extension.strip(".").lower() in valid_extensions

Expand Down

0 comments on commit 55b4229

Please sign in to comment.