diff --git a/CHANGELOG b/CHANGELOG index 5f5c2a0f1..5663e9c51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.35.2] - 2026-03-17 +### Fixed +- [PORTAL] [TEMPLATE] Wrong media-type for base64 encoded images + + ## [2.35.1] - 2026-03-06 ### Added - [API_PARSER] Add api_collector parameters in the returned representation of Frontends through APIs diff --git a/vulture_os/authentication/portal_template/models.py b/vulture_os/authentication/portal_template/models.py index cc54caba3..7ceeabc1a 100644 --- a/vulture_os/authentication/portal_template/models.py +++ b/vulture_os/authentication/portal_template/models.py @@ -417,8 +417,8 @@ def get_image_uri(self): :return: String containing the URI of the image. """ try: - url = 'portal_statics/{}'.format(self.uid) - except: + url = f"portal_statics/{self.uid}" + except Exception: return None return url @@ -429,7 +429,7 @@ def get_as_html(self): :return: A string with pre-formatted html for the image """ - return "".format(self.image_type, self.content) + return f"" def create_preview_html(self): """ @@ -437,4 +437,4 @@ def create_preview_html(self): :return: A string with pre-formatted html for the image """ - return "data:image/{};base64,{}".format(self.image_type, self.content) + return f"data:{self.image_type};base64,{self.content}" diff --git a/vulture_os/portal/system/authentications.py b/vulture_os/portal/system/authentications.py index 9b5a3c2ca..bf28d0b74 100644 --- a/vulture_os/portal/system/authentications.py +++ b/vulture_os/portal/system/authentications.py @@ -341,7 +341,7 @@ def authenticate(self, request): def ask_credentials_response(self, **kwargs): if self.workflow.authentication.enable_captcha: captcha_key = self.redis_portal_session.register_captcha(self.workflow.id) - captcha = "data:image/image/png;base64," + b64encode(ImageCaptcha().generate(captcha_key).read()).decode() + captcha = "data:image/png;base64," + b64encode(ImageCaptcha().generate(captcha_key).read()).decode() else: captcha = False