diff --git a/src/paperless_mail/views.py b/src/paperless_mail/views.py index a641aa360..e84e3b8e4 100644 --- a/src/paperless_mail/views.py +++ b/src/paperless_mail/views.py @@ -112,10 +112,10 @@ class OauthCallbackView(GenericAPIView): if scope is not None and "google" in scope: # Google # Gmail setup guide: https://postmansmtp.com/how-to-configure-post-smtp-with-gmailgsuite-using-oauth/ - account_type = MailAccount.AccountType.GMAIL + account_type = MailAccount.MailAccountType.GMAIL imap_server = "imap.gmail.com" defaults = { - "name": f"Gmail OAuth {datetime.now()}", + "name": f"Gmail OAuth {timezone.now()}", "username": "", "imap_security": MailAccount.ImapSecurity.SSL, "imap_port": 993, @@ -129,10 +129,10 @@ class OauthCallbackView(GenericAPIView): elif scope is None: # Outlook # Outlok setup guide: https://medium.com/@manojkumardhakad/python-read-and-send-outlook-mail-using-oauth2-token-and-graph-api-53de606ecfa1 - account_type = MailAccount.AccountType.OUTLOOK + account_type = MailAccount.MailAccountType.OUTLOOK imap_server = "outlook.office365.com" defaults = { - "name": f"Outlook OAuth {datetime.now()}", + "name": f"Outlook OAuth {timezone.now()}", "username": "", "imap_security": MailAccount.ImapSecurity.SSL, "imap_port": 993,