mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-18 03:00:49 +01:00
Merge pull request #529 from andresf01/master
Fixed encoding error in get_email
This commit is contained in:
commit
ea8d0d80a7
@ -323,7 +323,10 @@ def ticket_from_message(message, queue, logger):
|
|||||||
decodeUnknown(part.get_content_charset(), part.get_payload(decode=True))
|
decodeUnknown(part.get_content_charset(), part.get_payload(decode=True))
|
||||||
)
|
)
|
||||||
# workaround to get unicode text out rather than escaped text
|
# workaround to get unicode text out rather than escaped text
|
||||||
body = body.encode('ascii').decode('unicode_escape') if six.PY3 else body.encode('utf-8')
|
try:
|
||||||
|
body = body.encode('ascii').decode('unicode_escape')
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
body.encode('utf-8')
|
||||||
logger.debug("Discovered plain text MIME part")
|
logger.debug("Discovered plain text MIME part")
|
||||||
else:
|
else:
|
||||||
files.append(
|
files.append(
|
||||||
@ -369,6 +372,8 @@ def ticket_from_message(message, queue, logger):
|
|||||||
priority = 2 if high_priority_types & {smtp_priority, smtp_importance} else 3
|
priority = 2 if high_priority_types & {smtp_priority, smtp_importance} else 3
|
||||||
|
|
||||||
if ticket is None:
|
if ticket is None:
|
||||||
|
if settings.QUEUE_EMAIL_BOX_UPDATE_ONLY:
|
||||||
|
return None
|
||||||
new = True
|
new = True
|
||||||
t = Ticket.objects.create(
|
t = Ticket.objects.create(
|
||||||
title=subject,
|
title=subject,
|
||||||
|
@ -133,6 +133,7 @@ QUEUE_EMAIL_BOX_SSL = getattr(settings, 'QUEUE_EMAIL_BOX_SSL', None)
|
|||||||
QUEUE_EMAIL_BOX_HOST = getattr(settings, 'QUEUE_EMAIL_BOX_HOST', None)
|
QUEUE_EMAIL_BOX_HOST = getattr(settings, 'QUEUE_EMAIL_BOX_HOST', None)
|
||||||
QUEUE_EMAIL_BOX_USER = getattr(settings, 'QUEUE_EMAIL_BOX_USER', None)
|
QUEUE_EMAIL_BOX_USER = getattr(settings, 'QUEUE_EMAIL_BOX_USER', None)
|
||||||
QUEUE_EMAIL_BOX_PASSWORD = getattr(settings, 'QUEUE_EMAIL_BOX_PASSWORD', None)
|
QUEUE_EMAIL_BOX_PASSWORD = getattr(settings, 'QUEUE_EMAIL_BOX_PASSWORD', None)
|
||||||
|
QUEUE_EMAIL_BOX_UPDATE_ONLY = getattr(settings, 'QUEUE_EMAIL_BOX_UPDATE_ONLY', False)
|
||||||
|
|
||||||
# only allow users to access queues that they are members of?
|
# only allow users to access queues that they are members of?
|
||||||
HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION = getattr(
|
HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION = getattr(
|
||||||
|
Loading…
Reference in New Issue
Block a user