forked from extern/django-helpdesk
Merge pull request #517 from chriscz/fix-print
Make `saved_queries.py` printing python 3 compatible
This commit is contained in:
commit
fde06d3ab1
@ -5,7 +5,7 @@ templatetags/saved_queries.py - This template tag returns previously saved
|
|||||||
queries. Therefore you don't need to modify
|
queries. Therefore you don't need to modify
|
||||||
any views.
|
any views.
|
||||||
"""
|
"""
|
||||||
|
from __future__ import print_function
|
||||||
from django.template import Library
|
from django.template import Library
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from helpdesk.models import SavedSearch
|
from helpdesk.models import SavedSearch
|
||||||
@ -17,8 +17,9 @@ def saved_queries(user):
|
|||||||
return user_saved_queries
|
return user_saved_queries
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
import sys
|
import sys
|
||||||
print >> sys.stderr, "'saved_queries' template tag (django-helpdesk) crashed with following error:"
|
print("'saved_queries' template tag (django-helpdesk) crashed with following error:",
|
||||||
print >> sys.stderr, e
|
file=sys.stderr)
|
||||||
|
print(e, file=sys.stderr)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
register = Library()
|
register = Library()
|
||||||
|
Loading…
Reference in New Issue
Block a user