Browse Source

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.
version-14
Gavin D'souza 3 years ago
parent
commit
fd0564953b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      frappe/desk/doctype/kanban_board/kanban_board.py

+ 2
- 1
frappe/desk/doctype/kanban_board/kanban_board.py View File

@@ -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:


Loading…
Cancel
Save