1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-11-14 11:40:11 +01:00

Fix remote API key database lookup

This commit is contained in:
Piero Toffanin 2024-01-21 13:17:07 -05:00
parent c782fe108b
commit fa24655404

View File

@ -101,8 +101,11 @@ class RemoteDatabase:
print("Cannot authenticate API key: " + str(e))
return None
req_limit = res.get('req_limit', None) if res.get('error', None) is None else None
char_limit = res.get('char_limit', None) if res.get('error', None) is None else None
if res.get('error') is not None:
return None
req_limit = res.get('req_limit', None)
char_limit = res.get('char_limit', None)
self.cache[api_key] = (req_limit, char_limit)