mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-06-16 22:57:03 +02:00
fixes of python 3 test fails
This commit is contained in:
parent
71504aa85d
commit
8390125c01
@ -21,7 +21,6 @@ import logging
|
|||||||
logger = logging.getLogger('helpdesk')
|
logger = logging.getLogger('helpdesk')
|
||||||
|
|
||||||
from django.utils.encoding import smart_str
|
from django.utils.encoding import smart_str
|
||||||
from builtins import str as text
|
|
||||||
|
|
||||||
def send_templated_mail(template_name, email_context, recipients, sender=None, bcc=None, fail_silently=False, files=None):
|
def send_templated_mail(template_name, email_context, recipients, sender=None, bcc=None, fail_silently=False, files=None):
|
||||||
"""
|
"""
|
||||||
@ -119,7 +118,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
|
|||||||
"subject": t.subject,
|
"subject": t.subject,
|
||||||
}).render(context)
|
}).render(context)
|
||||||
|
|
||||||
if isinstance(recipients, text):
|
if isinstance(recipients, str):
|
||||||
if recipients.find(','):
|
if recipients.find(','):
|
||||||
recipients = recipients.split(',')
|
recipients = recipients.split(',')
|
||||||
elif type(recipients) != list:
|
elif type(recipients) != list:
|
||||||
|
@ -22,6 +22,9 @@ def get_staff_user(username='helpdesk.staff', password='password'):
|
|||||||
|
|
||||||
|
|
||||||
def reload_urlconf(urlconf=None):
|
def reload_urlconf(urlconf=None):
|
||||||
|
|
||||||
|
from imp import reload # python 3 needs this import.
|
||||||
|
|
||||||
if urlconf is None:
|
if urlconf is None:
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
@ -1080,7 +1080,7 @@ def run_report(request, report):
|
|||||||
)
|
)
|
||||||
except QueueMembership.DoesNotExist:
|
except QueueMembership.DoesNotExist:
|
||||||
queue_options = queue_options.none()
|
queue_options = queue_options.none()
|
||||||
possible_options = [q.title.encode('utf-8') for q in queue_options]
|
possible_options = [q.title for q in queue_options]
|
||||||
charttype = 'bar'
|
charttype = 'bar'
|
||||||
|
|
||||||
elif report == 'userstatus':
|
elif report == 'userstatus':
|
||||||
@ -1155,20 +1155,18 @@ def run_report(request, report):
|
|||||||
metric3 = ticket.modified - ticket.created
|
metric3 = ticket.modified - ticket.created
|
||||||
metric3 = metric3.days
|
metric3 = metric3.days
|
||||||
|
|
||||||
|
|
||||||
summarytable[metric1, metric2] += 1
|
summarytable[metric1, metric2] += 1
|
||||||
if metric3:
|
if metric3:
|
||||||
if report == 'daysuntilticketclosedbymonth':
|
if report == 'daysuntilticketclosedbymonth':
|
||||||
summarytable2[metric1, metric2] += metric3
|
summarytable2[metric1, metric2] += metric3
|
||||||
|
|
||||||
|
|
||||||
table = []
|
table = []
|
||||||
|
|
||||||
if report == 'daysuntilticketclosedbymonth':
|
if report == 'daysuntilticketclosedbymonth':
|
||||||
for key in summarytable2.keys():
|
for key in summarytable2.keys():
|
||||||
summarytable[key] = summarytable2[key] / summarytable[key]
|
summarytable[key] = summarytable2[key] / summarytable[key]
|
||||||
|
|
||||||
header1 = sorted(set(list( i.encode('utf-8') for i,_ in summarytable.keys() )))
|
header1 = sorted(set(list(i for i, _ in summarytable.keys())))
|
||||||
|
|
||||||
column_headings = [col1heading] + possible_options
|
column_headings = [col1heading] + possible_options
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user