From e5138af195e3864b2bc121982098e075d3960745 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 8 Aug 2017 14:32:32 +0530 Subject: [PATCH] [add] disable 2fa --- frappe/twofactor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/twofactor.py b/frappe/twofactor.py index 3e0fbf69de..cf49055d91 100644 --- a/frappe/twofactor.py +++ b/frappe/twofactor.py @@ -17,7 +17,6 @@ class ExpiredLoginException(Exception): pass def toggle_two_factor_auth(state, roles=[]): '''Enable or disable 2FA in site_config and roles''' - frappe.db.set_value('System Settings', None, 'enable_two_factor_auth', 1) for role in roles: role = frappe.get_doc('Role', {'role_name': role}) role.two_factor_auth = state @@ -365,3 +364,6 @@ def should_remove_barcode_image(barcode): return True return False +def disable(): + frappe.db.set_value('System Settings', None, 'enable_two_factor_auth', 0) +