Fix tests

This commit is contained in:
shamoon 2024-10-05 07:41:59 -07:00
parent 3386eaee6d
commit 61723528f2
2 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,7 @@ class TestMigrateWorkflow(TestMigrations):
dependencies = ( dependencies = (
( (
"paperless_mail", "paperless_mail",
"0026_mailrule_enabled", "0027_mailaccount_expiration_mailaccount_refresh_token",
), ),
) )

View File

@ -572,7 +572,11 @@ class MailAccountHandler(LoggingMixin):
account.imap_port, account.imap_port,
account.imap_security, account.imap_security,
) as M: ) 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}") self.log.debug(f"Attempting to refresh token for account {account}")
success = self.refresh_token(account) success = self.refresh_token(account)
if not success: if not success: