Преглед изворни кода

refactor: moves notification toggle to individual code block

version-14
Parth Kharwar пре 4 година
родитељ
комит
7effd9db7a
1 измењених фајлова са 3 додато и 5 уклоњено
  1. +3
    -5
      frappe/core/doctype/user/user.py

+ 3
- 5
frappe/core/doctype/user/user.py Прегледај датотеку

@@ -141,16 +141,14 @@ class User(Document):

if not cint(self.enabled):
self.a_system_manager_should_exist()
# disable notifications if the user has been disabled
toggle_notifications(self.name, enable=False)
else:
# enable notifications if the user has been enabled
toggle_notifications(self.name, enable=True)

# clear sessions if disabled
if not cint(self.enabled) and getattr(frappe.local, "login_manager", None):
frappe.local.login_manager.logout(user=self.name)

# toggle notifications based on the user's status
toggle_notifications(self.name, enable=cint(self.enabled))

def add_system_manager_role(self):
# if adding system manager, do nothing
if not cint(self.enabled) or ("System Manager" in [user_role.role for user_role in


Loading…
Откажи
Сачувај