Remove fail argument in TrueLayer

This commit is contained in:
Mark Veidemanis 2022-03-04 23:04:43 +00:00
parent 4033496866
commit cb4dbe18f6
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 1 additions and 10 deletions

View File

@ -23,9 +23,6 @@ class TrueLayer(object):
self.lc = LoopingCall(self.get_new_token) self.lc = LoopingCall(self.get_new_token)
self.lc.start(int(settings.TrueLayer.RefreshSec)) self.lc.start(int(settings.TrueLayer.RefreshSec))
def setup_auth(self):
pass
def create_auth_url(self): def create_auth_url(self):
query = urllib.parse.urlencode( query = urllib.parse.urlencode(
{ {
@ -63,7 +60,7 @@ class TrueLayer(object):
self.token = parsed["access_token"] self.token = parsed["access_token"]
self.log.info("Retrieved access/refresh tokens - TrueLayer") self.log.info("Retrieved access/refresh tokens - TrueLayer")
def get_new_token(self, fail=False): def get_new_token(self):
""" """
Exchange our refresh token for an access token. Exchange our refresh token for an access token.
""" """
@ -80,8 +77,6 @@ class TrueLayer(object):
try: try:
parsed = r.json() parsed = r.json()
except JSONDecodeError: except JSONDecodeError:
if fail:
exit()
return False return False
if r.status_code == 200: if r.status_code == 200:
if "access_token" in parsed.keys(): if "access_token" in parsed.keys():
@ -90,13 +85,9 @@ class TrueLayer(object):
return True return True
else: else:
self.log.error(f"Token refresh didn't contain access token: {parsed}", parsed=parsed) self.log.error(f"Token refresh didn't contain access token: {parsed}", parsed=parsed)
if fail:
exit()
return False return False
else: else:
self.log.error(f"Cannot refresh token: {parsed}", parsed=parsed) self.log.error(f"Cannot refresh token: {parsed}", parsed=parsed)
if fail:
exit()
return False return False
def get_accounts(self): def get_accounts(self):