Gmail.py use hardcoded url variable 2/2

Because the call in the if and in the else blocks is the same, we can move it outside the conditional block.

Code now is clear.
This commit is contained in:
Rodolfo García Peñas (kix) 2020-11-01 10:06:32 +01:00
parent 6b9f37e317
commit 852bc9acd9

View File

@ -57,11 +57,11 @@ class GmailRepository(IMAPRepository):
url = super().getoauth2_request_url()
if url is None:
# Nothing was configured, cache and return hardcoded one.
# Nothing was configured, use a hardcoded one.
url = "https://accounts.google.com/o/oauth2/token"
self.setoauth2_request_url(url)
else:
self.setoauth2_request_url(url)
return self.oauth2_request_url
def getport(self):