Skip to content

Commit

Permalink
TA#63236 [IMP] Correct flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
majouda committed Mar 6, 2024
1 parent 164e6c8 commit ec31cff
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions fetchmail_outlook_by_company/models/microsoft_outlook_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,29 @@ def _compute_outlook_uri_by_company(self):
record.microsoft_outlook_uri = False
continue

record.microsoft_outlook_uri = url_join(self._get_microsoft_endpoint(), 'authorize?%s' % url_encode({
'client_id': microsoft_outlook_client_id,
'response_type': 'code',
'redirect_uri': url_join(base_url, '/microsoft_outlook/confirm'),
'response_mode': 'query',
# offline_access is needed to have the refresh_token
'scope': 'offline_access %s' % self._OUTLOOK_SCOPE,
'state': json.dumps({
'model': record._name,
'id': record.id,
'csrf_token': record._get_outlook_csrf_token(),
})
}))
record.microsoft_outlook_uri = url_join(
self._get_microsoft_endpoint(),
"authorize?%s"
% url_encode(
{
"client_id": microsoft_outlook_client_id,
"response_type": "code",
"redirect_uri": url_join(
base_url, "/microsoft_outlook/confirm"
),
"response_mode": "query",
# offline_access is needed to have the refresh_token
"scope": "offline_access %s" % self._OUTLOOK_SCOPE,
"state": json.dumps(
{
"model": record._name,
"id": record.id,
"csrf_token": record._get_outlook_csrf_token(),
}
),
}
),
)

@api.depends('use_microsoft_outlook_service', 'company_id')
def _compute_outlook_uri(self):
Expand Down

0 comments on commit ec31cff

Please sign in to comment.