From 8d63d65a7d5e0ab94a5a95ae4be319c4a1363720 Mon Sep 17 00:00:00 2001 From: Martin Whitehouse Date: Mon, 25 Jul 2022 02:41:40 +0200 Subject: [PATCH] Removed encoding to 'utf-8', breaks tests. This needs to be looked into further. --- helpdesk/email.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helpdesk/email.py b/helpdesk/email.py index 9a3a7076..cac0d788 100644 --- a/helpdesk/email.py +++ b/helpdesk/email.py @@ -553,7 +553,7 @@ def get_encoded_body(body: str) -> str: try: return body.encode('ascii').decode('unicode_escape') except UnicodeEncodeError: - return body.encode('utf-8') + return body def get_body_from_fragments(body) -> str: @@ -637,7 +637,8 @@ def object_from_message(message: str, if ticket_id is None and getattr(django_settings, 'HELPDESK_FULL_FIRST_MESSAGE_FROM_EMAIL', False): # first message in thread, we save full body to avoid # losing forwards and things like that - body = EmailReplyParser.parse_reply(get_body_from_fragments(body)) + full_body = get_body_from_fragments(body) + body = EmailReplyParser.parse_reply(body) else: # second and other reply, save only first part of the # message