fix: workspace loading error

Workspace loads to fail if there are no links in any extended workspaces.
This commit is contained in:
leela 2021-06-26 09:37:08 +05:30
parent 916ec171fa
commit b7fb1d475e
2 changed files with 4 additions and 3 deletions

View file

@ -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()

View file

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