mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_pwa_oca: Guess properly mimetype
It seems since 3bd0327d6d
that the mimetype detection is not working properly for not fully
compliant SVG.
Let's resave SVG for having a compatible one + add a pointer when the
mimetype doesn't conform.
This commit is contained in:
committed by
sergio-teruel
parent
23b7e14206
commit
6b820d48d7
@@ -128,7 +128,10 @@ class ResConfigSettings(models.TransientModel):
|
||||
if not pwa_icon_mimetype.startswith(
|
||||
"image/svg"
|
||||
) and not pwa_icon_mimetype.startswith("image/png"):
|
||||
raise exceptions.UserError(_("You can only upload SVG or PNG files"))
|
||||
raise exceptions.UserError(
|
||||
_("You can only upload SVG or PNG files. Found: %s.")
|
||||
% pwa_icon_mimetype
|
||||
)
|
||||
# Delete all previous records if we are writting new ones
|
||||
if pwa_icon_ir_attachments:
|
||||
pwa_icon_ir_attachments.unlink()
|
||||
|
||||
Reference in New Issue
Block a user