forked from extern/django-helpdesk
Resorted imports for pep8
This commit is contained in:
parent
acb2e626a3
commit
c29996df94
@ -21,11 +21,6 @@ import email
|
|||||||
from email.message import Message
|
from email.message import Message
|
||||||
from email.utils import getaddresses
|
from email.utils import getaddresses
|
||||||
from email_reply_parser import EmailReplyParser
|
from email_reply_parser import EmailReplyParser
|
||||||
|
|
||||||
# Add OAUTH Libraries
|
|
||||||
from oauthlib.oauth2 import BackendApplicationClient
|
|
||||||
from requests_oauthlib import OAuth2Session
|
|
||||||
|
|
||||||
from helpdesk import settings
|
from helpdesk import settings
|
||||||
from helpdesk.exceptions import DeleteIgnoredTicketException, IgnoreTicketException
|
from helpdesk.exceptions import DeleteIgnoredTicketException, IgnoreTicketException
|
||||||
from helpdesk.lib import process_attachments, safe_template_context
|
from helpdesk.lib import process_attachments, safe_template_context
|
||||||
@ -33,10 +28,12 @@ from helpdesk.models import FollowUp, IgnoreEmail, Queue, Ticket
|
|||||||
import imaplib
|
import imaplib
|
||||||
import logging
|
import logging
|
||||||
import mimetypes
|
import mimetypes
|
||||||
|
from oauthlib.oauth2 import BackendApplicationClient
|
||||||
import os
|
import os
|
||||||
from os.path import isfile, join
|
from os.path import isfile, join
|
||||||
import poplib
|
import poplib
|
||||||
import re
|
import re
|
||||||
|
from requests_oauthlib import OAuth2Session
|
||||||
import socket
|
import socket
|
||||||
import ssl
|
import ssl
|
||||||
import sys
|
import sys
|
||||||
@ -48,7 +45,6 @@ from typing import List, Tuple
|
|||||||
# import User model, which may be a custom model
|
# import User model, which may be a custom model
|
||||||
User = get_user_model()
|
User = get_user_model()
|
||||||
|
|
||||||
|
|
||||||
STRIPPED_SUBJECT_STRINGS = [
|
STRIPPED_SUBJECT_STRINGS = [
|
||||||
"Re: ",
|
"Re: ",
|
||||||
"Fw: ",
|
"Fw: ",
|
||||||
@ -284,7 +280,7 @@ def imap_oauth_sync(q, logger, server):
|
|||||||
data = server.search(None, 'NOT', 'DELETED')[1]
|
data = server.search(None, 'NOT', 'DELETED')[1]
|
||||||
if data:
|
if data:
|
||||||
msgnums = data[0].split()
|
msgnums = data[0].split()
|
||||||
logger.info(f"Found {len(msgnums)} message(s) on IMAP server" )
|
logger.info(f"Found {len(msgnums)} message(s) on IMAP server")
|
||||||
for num in msgnums:
|
for num in msgnums:
|
||||||
logger.info(f"Processing message {num}")
|
logger.info(f"Processing message {num}")
|
||||||
data = server.fetch(num, '(RFC822)')[1]
|
data = server.fetch(num, '(RFC822)')[1]
|
||||||
@ -472,7 +468,6 @@ def is_autoreply(message):
|
|||||||
|
|
||||||
|
|
||||||
def create_ticket_cc(ticket, cc_list):
|
def create_ticket_cc(ticket, cc_list):
|
||||||
|
|
||||||
if not cc_list:
|
if not cc_list:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -504,7 +499,6 @@ def create_ticket_cc(ticket, cc_list):
|
|||||||
|
|
||||||
|
|
||||||
def create_object_from_email_message(message, ticket_id, payload, files, logger):
|
def create_object_from_email_message(message, ticket_id, payload, files, logger):
|
||||||
|
|
||||||
ticket, previous_followup, new = None, None, False
|
ticket, previous_followup, new = None, None, False
|
||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user