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
This commit is contained in:
Ankush Menat 2023-02-10 20:04:54 +05:30 committed by GitHub
parent c525268084
commit 1f6fdebff6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: