From b794f868ccb8c65792e824aa3e85ba8397cd2e40 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 20 Feb 2024 19:37:50 +0530 Subject: [PATCH] fix: never apply role profiles to standard user (#24968) --- frappe/core/doctype/user/user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index 4f5009b9c8..2524471cf5 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -184,6 +184,10 @@ class User(Document): if not self.role_profiles: return + if self.name in STANDARD_USERS: + self.role_profiles = [] + return + new_roles = set() for role_profile in self.role_profiles: role_profile = frappe.get_cached_doc("Role Profile", role_profile.role_profile)