19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:28 +01:00
parent 20ddc1b4a3
commit c0efcc53f5
1162 changed files with 125577 additions and 105287 deletions

View file

@ -23,17 +23,11 @@ class FetchmailServer(models.Model):
'the permissions.')
super(FetchmailServer, self - outlook_servers)._compute_server_type_info()
@api.depends('server_type')
def _compute_is_microsoft_outlook_configured(self):
outlook_servers = self.filtered(lambda server: server.server_type == 'outlook')
(self - outlook_servers).is_microsoft_outlook_configured = False
super(FetchmailServer, outlook_servers)._compute_is_microsoft_outlook_configured()
@api.constrains('server_type', 'is_ssl')
def _check_use_microsoft_outlook_service(self):
for server in self:
if server.server_type == 'outlook' and not server.is_ssl:
raise UserError(_('SSL is required for the server %r.', server.name))
raise UserError(_('SSL is required for server “%s”.', server.name))
@api.onchange('server_type')
def onchange_server_type(self):
@ -46,9 +40,9 @@ class FetchmailServer(models.Model):
self.microsoft_outlook_refresh_token = False
self.microsoft_outlook_access_token = False
self.microsoft_outlook_access_token_expiration = False
super(FetchmailServer, self).onchange_server_type()
super().onchange_server_type()
def _imap_login(self, connection):
def _imap_login__(self, connection): # noqa: PLW3201
"""Authenticate the IMAP connection.
If the mail server is Outlook, we use the OAuth2 authentication protocol.
@ -59,7 +53,7 @@ class FetchmailServer(models.Model):
connection.authenticate('XOAUTH2', lambda x: auth_string)
connection.select('INBOX')
else:
super()._imap_login(connection)
super()._imap_login__(connection)
def _get_connection_type(self):
"""Return which connection must be used for this mail server (IMAP or POP).