mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-13 10:21:05 +01:00
Wrap message.encode() in conditional for Python 2
This commit is contained in:
parent
f16a196c69
commit
b263b22cca
@ -260,7 +260,7 @@ def decode_mail_headers(string):
|
||||
|
||||
def ticket_from_message(message, queue, logger):
|
||||
# 'message' must be an RFC822 formatted message.
|
||||
message = email.message_from_string(message.encode('utf-8'))
|
||||
message = email.message_from_string(message.encode('utf-8') if six.PY2 else message)
|
||||
subject = message.get('subject', _('Created from e-mail'))
|
||||
subject = decode_mail_headers(decodeUnknown(message.get_charset(), subject))
|
||||
for affix in STRIPPED_SUBJECT_STRINGS:
|
||||
|
Loading…
Reference in New Issue
Block a user