mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
testing on feature
This commit is contained in:
parent
af8d283765
commit
53ab53034b
2 changed files with 4 additions and 4 deletions
|
|
@ -233,7 +233,7 @@ class Mailbox(models.Model):
|
|||
folder=self.folder,
|
||||
archive=self.archive
|
||||
)
|
||||
conn.connect(self.client_id, self.client_secret, self.tenant_id)
|
||||
conn.connect()
|
||||
elif self.type == 'pop3':
|
||||
conn = Pop3Transport(
|
||||
self.location,
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class Office365Transport(EmailTransport):
|
|||
self.archive = archive
|
||||
self.folder = folder
|
||||
|
||||
def connect(self, client_id, client_secret, tenant_id):
|
||||
def connect(self):
|
||||
try:
|
||||
import O365
|
||||
except ImportError:
|
||||
|
|
@ -95,9 +95,9 @@ class Office365Transport(EmailTransport):
|
|||
"Install o365 to use oauth2 auth for office365"
|
||||
)
|
||||
|
||||
credentials = (client_id, client_secret)
|
||||
credentials = (settings.MICROSOFT_O365_CLIENT_ID, settings.MICROSOFT_O365_CLIENT_SECRET)
|
||||
|
||||
self.account = O365.Account(credentials, auth_flow_type='credentials', tenant_id=tenant_id)
|
||||
self.account = O365.Account(credentials, auth_flow_type='credentials', tenant_id=settings.MICROSOFT_O365_TENENT_ID)
|
||||
self.account.authenticate()
|
||||
|
||||
self.mailbox = self.account.mailbox(resource=self.username)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue