diff --git a/helpdesk/templatetags/saved_queries.py b/helpdesk/templatetags/saved_queries.py index 057ef119..b52240a1 100644 --- a/helpdesk/templatetags/saved_queries.py +++ b/helpdesk/templatetags/saved_queries.py @@ -12,8 +12,13 @@ from helpdesk.models import SavedSearch def saved_queries(request): - user_saved_queries = SavedSearch.objects.filter(Q(user=request.user) | Q(shared__exact=True)) - return user_saved_queries + try: + user_saved_queries = SavedSearch.objects.filter(Q(user=request.user) | Q(shared__exact=True)) + return user_saved_queries + except Exception, e: + print "'saved_queries' template tag (django-helpdesk) crashed with following error:" + print e + return '' register = Library() register.filter('saved_queries', saved_queries)