From 14689820433c01015f393b8e576382727e45662c Mon Sep 17 00:00:00 2001 From: Martin Whitehouse Date: Mon, 25 Jul 2022 03:50:49 +0200 Subject: [PATCH] Remove unused variables, extract correct index --- helpdesk/email.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpdesk/email.py b/helpdesk/email.py index 03f26e9a..60e476a9 100644 --- a/helpdesk/email.py +++ b/helpdesk/email.py @@ -177,13 +177,13 @@ def imap_sync(q, logger, server): sys.exit() try: - status, data = server.search(None, 'NOT', 'DELETED') + data = server.search(None, 'NOT', 'DELETED')[1] if data: msgnums = data[0].split() logger.info("Received %d messages from IMAP server" % len(msgnums)) for num in msgnums: logger.info("Processing message %s" % num) - status, data = server.fetch(num, '(RFC822)') + data = server.fetch(num, '(RFC822)')[1] full_message = encoding.force_str(data[0][1], errors='replace') try: ticket = object_from_message( @@ -346,7 +346,7 @@ def create_ticket_cc(ticket, cc_list): from helpdesk.views.staff import subscribe_to_ticket_updates, User new_ticket_ccs = [] - for cced_name, cced_email in cc_list: + for __, cced_email in cc_list: cced_email = cced_email.strip() if cced_email == ticket.queue.email_address: