Skip to content

Commit

Permalink
fix: delete old user notification settings when merging users (#26604) (
Browse files Browse the repository at this point in the history
#26619)

(cherry picked from commit e97a56b)

Co-authored-by: Dhia' Shalabi <dhia.shalabi@gmail.com>
  • Loading branch information
mergify[bot] and dhiashalabi committed May 31, 2024
1 parent fc2a852 commit af1a47d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frappe/core/doctype/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,10 @@ def on_trash(self):
frappe.throw(_("You can disable the user instead of deleting it."), frappe.LinkExistsError)

def before_rename(self, old_name, new_name, merge=False):
# if merging, delete the old user notification settings
if merge:
frappe.delete_doc("Notification Settings", old_name, ignore_permissions=True)

frappe.clear_cache(user=old_name)
self.validate_rename(old_name, new_name)

Expand Down

0 comments on commit af1a47d

Please sign in to comment.