Merge pull request #322 from atmaniak/master

Fix exception for templetags
This commit is contained in:
Ross Poulton 2015-05-12 17:05:52 +10:00
commit 1ff45f4e1b
2 changed files with 12 additions and 12 deletions

View File

@ -9,13 +9,13 @@ from django.template import Library
from helpdesk import settings as helpdesk_settings_config
def load_helpdesk_settings(request):
# try:
try:
return helpdesk_settings_config
# except Exception, e:
# import sys
# print >> sys.stderr, "'load_helpdesk_settings' template tag (django-helpdesk) crashed with following error:"
# print >> sys.stderr, e
# return ''
except Exception as e:
import sys
print >> sys.stderr, "'load_helpdesk_settings' template tag (django-helpdesk) crashed with following error:"
print >> sys.stderr, e
return ''
register = Library()
register.filter('load_helpdesk_settings', load_helpdesk_settings)

View File

@ -12,14 +12,14 @@ from helpdesk.models import SavedSearch
def saved_queries(user):
# try:
try:
user_saved_queries = SavedSearch.objects.filter(Q(user=user) | Q(shared__exact=True))
return user_saved_queries
# except Exception, e:
# import sys
# print >> sys.stderr, "'saved_queries' template tag (django-helpdesk) crashed with following error:"
# print >> sys.stderr, e
# return ''
except Exception as e:
import sys
print >> sys.stderr, "'saved_queries' template tag (django-helpdesk) crashed with following error:"
print >> sys.stderr, e
return ''
register = Library()
register.filter('saved_queries', saved_queries)