From fd0564953b0d5dd32d563617b1894e48d0aa8c55 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 5 Apr 2022 15:30:46 +0530 Subject: [PATCH] fix(Kanban Board): Clear user settings & dpctype cache on_change Deletion of kanban boards may lead to 404s on clicking on the Kanban option in the views. This is due to the cache not being synced with the DB changes. Changed the hook to on_change since it gets triggered even in db_set. --- frappe/desk/doctype/kanban_board/kanban_board.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/desk/doctype/kanban_board/kanban_board.py b/frappe/desk/doctype/kanban_board/kanban_board.py index 97f529a061..a53045b096 100644 --- a/frappe/desk/doctype/kanban_board/kanban_board.py +++ b/frappe/desk/doctype/kanban_board/kanban_board.py @@ -12,8 +12,9 @@ class KanbanBoard(Document): def validate(self): self.validate_column_name() - def on_update(self): + def on_change(self): frappe.clear_cache(doctype=self.reference_doctype) + frappe.cache().delete_keys("_user_settings") def before_insert(self): for column in self.columns: