From 7982774ee11979cb1389dd9870c8507e9db00414 Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Tue, 27 Feb 2018 20:18:51 -0500 Subject: [PATCH] Apply hotfix for get_email fails, #590 --- helpdesk/management/commands/get_email.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index f7d00724..e0a329c3 100755 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -235,7 +235,10 @@ def process_queue(q, logger): logger.info("Processing message %s" % num) status, data = server.fetch(num, '(RFC822)') full_message = encoding.force_text(data[0][1], errors='replace') - ticket = ticket_from_message(message=full_message, queue=q, logger=logger) + try: + ticket = ticket_from_message(message=full_message, queue=q, logger=logger) + except TypeError: + ticket = None # hotfix. Need to work out WHY. if ticket: server.store(num, '+FLAGS', '\\Deleted') logger.info("Successfully processed message %s, deleted from IMAP server" % num)