diff --git a/delivery_carrier_label_postlogistics/postlogistics/web_service.py b/delivery_carrier_label_postlogistics/postlogistics/web_service.py index 0611c0790c..334533a7db 100644 --- a/delivery_carrier_label_postlogistics/postlogistics/web_service.py +++ b/delivery_carrier_label_postlogistics/postlogistics/web_service.py @@ -115,9 +115,9 @@ def _prepare_customer(self, picking): } logo = company.postlogistics_logo if logo: - logo_image = Image.open(StringIO(logo.decode('base64'))) + logo_image = Image.open(StringIO(logo.decode())) logo_format = logo_image.format - customer['logo'] = logo + customer['logo'] = logo.decode() customer['logoFormat'] = logo_format return customer @@ -423,7 +423,7 @@ def generate_label(self, picking, packages, user_lang=None): res['success'] = False res['errors'] = [ _('Error when communicating with swisspost API: %s') % - response.json() + response.content.decode("utf-8") ] return res