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
  • Loading branch information
dhiashalabi committed May 30, 2024
1 parent 847012e commit e97a56b
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 @@ -543,6 +543,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 e97a56b

Please sign in to comment.