fix: allow using login_with_email_link if user_pass_login is disabled

unrelated fix
This commit is contained in:
Shariq Ansari 2023-01-04 19:20:36 +05:30
parent 97fc172bb9
commit 80ceb33c01

View file

@ -50,11 +50,14 @@ class SystemSettings(Document):
social_login_enabled = frappe.db.exists("Social Login Key", {"enable_social_login": 1})
ldap_enabled = frappe.db.get_single_value("LDAP Settings", "enabled")
login_with_email_link_enabled = frappe.db.get_single_value(
"System Settings", "login_with_email_link"
)
if not (social_login_enabled or ldap_enabled):
if not (social_login_enabled or ldap_enabled or login_with_email_link_enabled):
frappe.throw(
_(
"Please enable atleast one Social Login Key or LDAP before disabling username/password based login."
"Please enable atleast one Social Login Key or LDAP or Login With Email Link before disabling username/password based login."
)
)