From 5e37ab3d94aaa4cfe9a1aa0cfb8de9dd1fd898e8 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 7 Jan 2015 05:01:28 -0400 Subject: [PATCH] Show smart link generation erros --- mayan/apps/linking/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mayan/apps/linking/views.py b/mayan/apps/linking/views.py index b034fa162e..56d53da9ce 100644 --- a/mayan/apps/linking/views.py +++ b/mayan/apps/linking/views.py @@ -60,7 +60,13 @@ def smart_link_instance_view(request, document_id, smart_link_pk): def smart_link_instances_for_document(request, document_id): document = get_object_or_404(Document, pk=document_id) - queryset = SmartLink.objects.get_for(document) + try: + queryset = SmartLink.objects.get_for(document) + except Exception as exception: + queryset = [] + messages.error(request, _(u'Error calculating smart link for: %(document)s; %(exception)s.') % + {'document': document, 'exception': exception} + ) try: Permission.objects.check_permissions(request.user, [PERMISSION_SMART_LINK_VIEW])