refactor(workspace): Optimize save call on workspace doc (#24052)
Optimize Workspace.save_page to call doc.save() only once therefore eliminate sending unnecessary queries to database. Signed-off-by: Xiaoguang Sun <sunxiaoguang@gmail.com>
This commit is contained in:
parent
64c221343e
commit
1fe3b5d5bc
2 changed files with 1 additions and 2 deletions
|
|
@ -565,7 +565,7 @@ def save_new_widget(doc, page, blocks, new_widgets):
|
|||
page, json_config, e
|
||||
)
|
||||
doc.log_error("Could not save customization", log)
|
||||
return False
|
||||
raise
|
||||
|
||||
return True
|
||||
|
||||
|
|
|
|||
|
|
@ -277,7 +277,6 @@ def save_page(title, public, new_widgets, blocks):
|
|||
doc = frappe.get_doc("Workspace", pages[0])
|
||||
|
||||
doc.content = blocks
|
||||
doc.save(ignore_permissions=True)
|
||||
|
||||
save_new_widget(doc, title, blocks, new_widgets)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue