From 512f07400d0ca6687bda6ed0164602177a3ffa2f Mon Sep 17 00:00:00 2001 From: j Date: Fri, 7 Jul 2023 11:49:56 +0530 Subject: [PATCH] don't fail if hidden is not set --- pandora/documentcollection/views.py | 2 +- pandora/edit/views.py | 2 +- pandora/itemlist/views.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/documentcollection/views.py b/pandora/documentcollection/views.py index bb789dea..cfe3e8f7 100644 --- a/pandora/documentcollection/views.py +++ b/pandora/documentcollection/views.py @@ -99,7 +99,7 @@ def findCollections(request, data): else: qs = _order_query(query['qs'], query['sort']) - if is_personal and request.user.profile.ui['hidden']['collections']: + if is_personal and request.user.profile.ui.get('hidden', {}).get('collections'): qs = qs.exclude(name__in=request.user.profile.ui['hidden']['collections']) response = json_response() diff --git a/pandora/edit/views.py b/pandora/edit/views.py index 9a37d784..d4bccf82 100644 --- a/pandora/edit/views.py +++ b/pandora/edit/views.py @@ -425,7 +425,7 @@ def findEdits(request, data): else: qs = _order_query(query['qs'], query['sort']) - if is_personal and request.user.profile.ui['hidden']['edits']: + if is_personal and request.user.profile.ui.get('hidden', {}).get('edits'): qs = qs.exclude(name__in=request.user.profile.ui['hidden']['edits']) response = json_response() diff --git a/pandora/itemlist/views.py b/pandora/itemlist/views.py index 19c5eb5c..82857d45 100644 --- a/pandora/itemlist/views.py +++ b/pandora/itemlist/views.py @@ -97,7 +97,7 @@ def findLists(request, data): else: qs = _order_query(query['qs'], query['sort']) - if is_personal and request.user.profile.ui['hidden']['lists']: + if is_personal and request.user.profile.ui.get('hidden', {}).get('lists'): qs = qs.exclude(name__in=request.user.profile.ui['hidden']['lists']) response = json_response()