From 1f6fdebff6af96b3bd80487d9e69bd38f65a6f22 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 10 Feb 2023 20:04:54 +0530 Subject: [PATCH] fix: login before check should be inclusive (#19974) e.g. if login_before hour is 6 and it's 6:30 then it should be blocked. related :) - https://fhur.me/posts/always-use-closed-open-intervals --- frappe/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/auth.py b/frappe/auth.py index 3321784ce2..f1cdac52bd 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -307,7 +307,7 @@ class LoginManager: current_hour = int(now_datetime().strftime("%H")) - if login_before and current_hour > login_before: + if login_before and current_hour >= login_before: frappe.throw(_("Login not allowed at this time"), frappe.AuthenticationError) if login_after and current_hour < login_after: