Fix formatting

This commit is contained in:
Christopher Broderick 2023-10-24 14:08:40 +01:00
parent 4f65d9cd8e
commit a7863b5f27

View File

@ -57,7 +57,7 @@ STRIPPED_SUBJECT_STRINGS = [
HTML_EMAIL_ATTACHMENT_FILENAME = _("email_html_body.html")
def process_email(quiet: bool =False, debug_to_stdout=False):
def process_email(quiet: bool = False, debug_to_stdout: bool = False):
if debug_to_stdout:
print("Extracting email into queues...")
q: Queue() # Typing ahead of time for loop to make it more useful in an IDE
@ -67,7 +67,6 @@ def process_email(quiet: bool =False, debug_to_stdout=False):
log_msg = f"Processing queue: {q.slug} Email address: {q.email_address}..."
if debug_to_stdout:
print(log_msg)
logger = logging.getLogger('django.helpdesk.queue.' + q.slug)
logging_types = {
'info': logging.INFO,
@ -104,8 +103,8 @@ def process_email(quiet: bool =False, debug_to_stdout=False):
logger.info(log_msg)
if debug_to_stdout:
print(log_msg)
except Exception as e:
logger.error("Queue processing failed: {q.slug}", exc_info=True)
except Exception:
logger.error("Queue processing failed: {q.slug} -- {e}", exc_info=True)
if debug_to_stdout:
print(f"Queue processing failed: {q.slug}")
print("-"*60)