mirror of
				https://github.com/LibreTranslate/LibreTranslate.git
				synced 2025-11-03 19:17:17 -05:00 
			
		
		
		
	return None on failed remote key lookup
This commit is contained in:
		
							parent
							
								
									ed68f1bcf9
								
							
						
					
					
						commit
						47fc85fdec
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user