diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index 9561dcb737..f36553593b 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -364,7 +364,11 @@ class User(Document): # delete todos frappe.db.delete("ToDo", {"owner": self.name}) todo_table = DocType("ToDo") - frappe.qb.update(todo_table).set(todo_table.assigned_by, None).where(todo_table.assigned_by == self.name).run() + ( + frappe.qb.update(todo_table) + .set(todo_table.assigned_by, None) + .where(todo_table.assigned_by == self.name) + ).run() # delete events frappe.db.delete("Event", {"owner": self.name, "event_type": "Private"}) diff --git a/frappe/core/notifications.py b/frappe/core/notifications.py index d091983d00..a69c644383 100644 --- a/frappe/core/notifications.py +++ b/frappe/core/notifications.py @@ -61,7 +61,12 @@ def get_unread_emails(): communication_doctype = DocType("Communication") user_doctype = DocType("User") - distinct_email_accounts = frappe.qb.from_(user_doctype).select(user_doctype.email_account).where(user_doctype.parent == frappe.session.user).distinct() + distinct_email_accounts = ( + frappe.qb.from_(user_doctype) + .select(user_doctype.email_account) + .where(user_doctype.parent == frappe.session.user) + .distinct() + ) return frappe.db.count(communication_doctype, filters=( (communication_doctype.communication_type == "Communication")