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:
parent
6b9f37e317
commit
852bc9acd9
@ -57,11 +57,11 @@ class GmailRepository(IMAPRepository):
|
|||||||
|
|
||||||
url = super().getoauth2_request_url()
|
url = super().getoauth2_request_url()
|
||||||
if url is None:
|
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"
|
url = "https://accounts.google.com/o/oauth2/token"
|
||||||
|
|
||||||
self.setoauth2_request_url(url)
|
self.setoauth2_request_url(url)
|
||||||
else:
|
|
||||||
self.setoauth2_request_url(url)
|
|
||||||
return self.oauth2_request_url
|
return self.oauth2_request_url
|
||||||
|
|
||||||
def getport(self):
|
def getport(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user