consistent in return statements

This commit is contained in:
Florian Bezannier
2021-03-22 12:18:23 +01:00
parent 8bb528d92f
commit c231f7f866
2 changed files with 2 additions and 1 deletions
+2
View File
@@ -85,11 +85,13 @@ class Cars(list):
for car in self:
if car.vin == vin:
return car
return None
def get_car_by_id(self, vehicle_id) -> Car:
for car in self:
if car.vehicle_id == vehicle_id:
return car
return None
def add(self, car: Car):
if self.get_car_by_id(car.vehicle_id) is None:
-1
View File
@@ -23,7 +23,6 @@ def get_temp(latitude:str, longitude:str, api_key:str) -> float:
except KeyError:
logger.error("Unable to get temperature from openweathermap :%s", traceback.format_exc())
def rate_limit(limit, every):
def limit_decorator(fn):
semaphore = Semaphore(limit)