diff --git a/helpdesk/lib.py b/helpdesk/lib.py index 3e031190..647ce962 100644 --- a/helpdesk/lib.py +++ b/helpdesk/lib.py @@ -21,6 +21,7 @@ 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): """ @@ -118,7 +119,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b "subject": t.subject, }).render(context) - if isinstance(recipients,(str,unicode)): + if isinstance(recipients, text): if recipients.find(','): recipients = recipients.split(',') elif type(recipients) != list: diff --git a/helpdesk/tests/test_navigation.py b/helpdesk/tests/test_navigation.py index 832de974..44c37983 100644 --- a/helpdesk/tests/test_navigation.py +++ b/helpdesk/tests/test_navigation.py @@ -29,7 +29,7 @@ class TestKBDisabled(TestCase): self.assertRaises(NoReverseMatch, reverse, 'helpdesk_kb_index') try: response = self.client.get(reverse('helpdesk_dashboard')) - except NoReverseMatch, e: + except NoReverseMatch as e: if 'helpdesk_kb_index' in e.message: self.fail("Please verify any unchecked references to helpdesk_kb_index (start with navigation.html)") else: