diff --git a/helpdesk/lib.py b/helpdesk/lib.py index 647ce962..397a415c 100644 --- a/helpdesk/lib.py +++ b/helpdesk/lib.py @@ -21,7 +21,6 @@ import logging logger = logging.getLogger('helpdesk') 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): """ @@ -119,7 +118,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b "subject": t.subject, }).render(context) - if isinstance(recipients, text): + if isinstance(recipients, str): if recipients.find(','): recipients = recipients.split(',') elif type(recipients) != list: diff --git a/helpdesk/tests/helpers.py b/helpdesk/tests/helpers.py index 67715c90..b64970be 100644 --- a/helpdesk/tests/helpers.py +++ b/helpdesk/tests/helpers.py @@ -22,6 +22,9 @@ def get_staff_user(username='helpdesk.staff', password='password'): def reload_urlconf(urlconf=None): + + from imp import reload # python 3 needs this import. + if urlconf is None: from django.conf import settings diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index af30017d..a20a3205 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -1080,7 +1080,7 @@ def run_report(request, report): ) except QueueMembership.DoesNotExist: 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' elif report == 'userstatus': @@ -1155,20 +1155,18 @@ def run_report(request, report): metric3 = ticket.modified - ticket.created metric3 = metric3.days - summarytable[metric1, metric2] += 1 if metric3: if report == 'daysuntilticketclosedbymonth': summarytable2[metric1, metric2] += metric3 - table = [] if report == 'daysuntilticketclosedbymonth': for key in summarytable2.keys(): 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