Fix tests
This commit is contained in:
parent
3386eaee6d
commit
61723528f2
@ -8,7 +8,7 @@ class TestMigrateWorkflow(TestMigrations):
|
||||
dependencies = (
|
||||
(
|
||||
"paperless_mail",
|
||||
"0026_mailrule_enabled",
|
||||
"0027_mailaccount_expiration_mailaccount_refresh_token",
|
||||
),
|
||||
)
|
||||
|
||||
|
@ -572,7 +572,11 @@ class MailAccountHandler(LoggingMixin):
|
||||
account.imap_port,
|
||||
account.imap_security,
|
||||
) as M:
|
||||
if account.is_token and account.expiration < timezone.now():
|
||||
if (
|
||||
account.is_token
|
||||
and account.expiration is not None
|
||||
and account.expiration < timezone.now()
|
||||
):
|
||||
self.log.debug(f"Attempting to refresh token for account {account}")
|
||||
success = self.refresh_token(account)
|
||||
if not success:
|
||||
|
Loading…
x
Reference in New Issue
Block a user