Переглянути джерело

[add] disable 2fa

version-14
Rushabh Mehta 8 роки тому
джерело
коміт
e5138af195
1 змінених файлів з 3 додано та 1 видалено
  1. +3
    -1
      frappe/twofactor.py

+ 3
- 1
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)


Завантаження…
Відмінити
Зберегти