From b7fb1d475ecfab9be51d312e9ce2f79281916c73 Mon Sep 17 00:00:00 2001 From: leela Date: Sat, 26 Jun 2021 09:37:08 +0530 Subject: [PATCH] fix: workspace loading error Workspace loads to fail if there are no links in any extended workspaces. --- frappe/desk/desktop.py | 1 + frappe/desk/doctype/workspace/workspace.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frappe/desk/desktop.py b/frappe/desk/desktop.py index 0a7d436169..cdab7d6d1b 100644 --- a/frappe/desk/desktop.py +++ b/frappe/desk/desktop.py @@ -368,6 +368,7 @@ def get_desktop_page(page): 'allow_customization': not wspace.doc.disable_user_customization } except DoesNotExistError: + frappe.log_error(frappe.get_traceback()) return {} @frappe.whitelist() diff --git a/frappe/desk/doctype/workspace/workspace.py b/frappe/desk/doctype/workspace/workspace.py index 0b5babc8d9..41b0227f2a 100644 --- a/frappe/desk/doctype/workspace/workspace.py +++ b/frappe/desk/doctype/workspace/workspace.py @@ -43,19 +43,19 @@ class Workspace(Document): def get_link_groups(self): cards = [] - current_card = { + current_card = frappe._dict({ "label": "Link", "type": "Card Break", "icon": None, "hidden": False, - } + }) card_links = [] for link in self.links: link = link.as_dict() if link.type == "Card Break": - if card_links and (not current_card.only_for or current_card.only_for == frappe.get_system_settings('country')): + if card_links and (not current_card.only_for or current_card.only_for == frappe.get_system_settings('country')): current_card['links'] = card_links cards.append(current_card)