diff --git a/terrariumArea.py b/terrariumArea.py index a0be7d3f6..9d3f5c16c 100644 --- a/terrariumArea.py +++ b/terrariumArea.py @@ -125,7 +125,7 @@ def make_time_table(begin, end, on_period=0, off_period=0): logger.debug(f"Begin time is bigger then end time (swap). Add 24 hours to end time (next day) {self}") end += datetime.timedelta(hours=24) if begin <= now + datetime.timedelta(hours=24) < end: - #Calculating this at a timestamp before the begin time, can case a power down, while the end time has not passed (previous day on) + # Calculating this at a timestamp before the begin time, can case a power down, while the end time has not passed (previous day on) begin -= datetime.timedelta(hours=24) end -= datetime.timedelta(hours=24) diff --git a/terrariumWebserver.py b/terrariumWebserver.py index b2b104663..46f97a47e 100644 --- a/terrariumWebserver.py +++ b/terrariumWebserver.py @@ -78,7 +78,9 @@ def decorator(func): @functools.wraps(func) def wrapper(*a, **ka): # Get user info from auth request, then from cookie or else nothing - user, password = request.auth or json.loads(request.get_cookie("auth", secret=self.cookie_secret) or "[null, null]") + user, password = request.auth or json.loads( + request.get_cookie("auth", secret=self.cookie_secret) or "[null, null]" + ) if int(self.engine.settings["always_authenticate"]) != -1 and ( required or terrariumUtils.is_true(self.engine.settings["always_authenticate"]) @@ -359,7 +361,9 @@ def url_for(self, name, **kwargs): return url def __login(self): - response.set_cookie("auth", json.dumps(request.auth), secret=self.cookie_secret, **{"max_age": 3600, "path": "/"}) + response.set_cookie( + "auth", json.dumps(request.auth), secret=self.cookie_secret, **{"max_age": 3600, "path": "/"} + ) if request.is_ajax: return {"location": self.url_for("home"), "message": "User logged in."}