mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-22 07:51:00 +00:00
return None on failed remote key lookup
This commit is contained in:
parent
ed68f1bcf9
commit
47fc85fdec
1 changed files with 3 additions and 4 deletions
|
@ -76,13 +76,12 @@ class RemoteDatabase:
|
|||
res = r.json()
|
||||
except Exception as e:
|
||||
print("Cannot authenticate API key: " + str(e))
|
||||
return False
|
||||
return None
|
||||
|
||||
if res.get('error', None) is None:
|
||||
req_limit = res.get('req_limit', None)
|
||||
self.cache[api_key] = req_limit
|
||||
else:
|
||||
req_limit = False
|
||||
self.cache[api_key] = False
|
||||
req_limit = None
|
||||
self.cache[api_key] = req_limit
|
||||
|
||||
return req_limit
|
||||
|
|
Loading…
Reference in a new issue