From d18ce1f1d54a4d8c0b4e0d9770fce5236de9a917 Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Thu, 28 Dec 2017 09:11:34 -0500 Subject: [PATCH] Bump version to 0.2.6 to fix remaining Django 2.0 warnings --- demo/setup.py | 2 +- helpdesk/decorators.py | 2 +- helpdesk/forms.py | 2 +- helpdesk/models.py | 16 ++++++++-------- helpdesk/templatetags/ticket_to_link.py | 2 +- helpdesk/tests/helpers.py | 4 ++-- helpdesk/tests/test_attachments.py | 2 +- helpdesk/tests/test_navigation.py | 4 ++-- .../tests/test_per_queue_staff_permission.py | 2 +- helpdesk/tests/test_public_actions.py | 2 +- helpdesk/tests/test_savequery.py | 2 +- helpdesk/tests/test_ticket_actions.py | 2 +- helpdesk/tests/test_ticket_lookup.py | 2 +- helpdesk/tests/test_ticket_submission.py | 2 +- helpdesk/tests/test_usersettings.py | 2 +- helpdesk/views/feeds.py | 2 +- helpdesk/views/public.py | 2 +- helpdesk/views/staff.py | 2 +- setup.py | 2 +- 19 files changed, 28 insertions(+), 28 deletions(-) diff --git a/demo/setup.py b/demo/setup.py index 2cfdd613..fbcebce1 100644 --- a/demo/setup.py +++ b/demo/setup.py @@ -13,7 +13,7 @@ project_root = os.path.dirname(here) NAME = 'django-helpdesk-demodesk' DESCRIPTION = 'A demo Django project using django-helpdesk' README = open(os.path.join(here, 'README.rst')).read() -VERSION = '0.2.5' +VERSION = '0.2.6' #VERSION = open(os.path.join(project_root, 'VERSION')).read().strip() AUTHOR = 'django-helpdesk team' URL = 'https://github.com/django-helpdesk/django-helpdesk' diff --git a/helpdesk/decorators.py b/helpdesk/decorators.py index cb0adeac..47dc5911 100644 --- a/helpdesk/decorators.py +++ b/helpdesk/decorators.py @@ -1,6 +1,6 @@ from functools import wraps -from django.core.urlresolvers import reverse +from django.urls import reverse from django.http import HttpResponseRedirect, Http404 from django.utils.decorators import available_attrs diff --git a/helpdesk/forms.py b/helpdesk/forms.py index 7ab2024f..1195e5d0 100644 --- a/helpdesk/forms.py +++ b/helpdesk/forms.py @@ -11,7 +11,7 @@ forms.py - Definitions of newforms-based forms for creating and maintaining from django.core.exceptions import ObjectDoesNotExist from django.utils.six import StringIO from django import forms -from django.forms import extras +from django.forms import widgets from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.contrib.auth import get_user_model diff --git a/helpdesk/models.py b/helpdesk/models.py index a45da370..a1978346 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -528,7 +528,7 @@ class Ticket(models.Model): """ from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured - from django.core.urlresolvers import reverse + from django.urls import reverse try: site = Site.objects.get_current() except ImproperlyConfigured: @@ -548,7 +548,7 @@ class Ticket(models.Model): """ from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured - from django.core.urlresolvers import reverse + from django.urls import reverse try: site = Site.objects.get_current() except ImproperlyConfigured: @@ -581,8 +581,8 @@ class Ticket(models.Model): return '%s %s' % (self.id, self.title) def get_absolute_url(self): - return 'helpdesk:view', (self.id,) - get_absolute_url = models.permalink(get_absolute_url) + from django.urls import reverse + return reverse('helpdesk:view', args=(self.id,)) def save(self, *args, **kwargs): if not self.id: @@ -970,8 +970,8 @@ class KBCategory(models.Model): verbose_name_plural = _('Knowledge base categories') def get_absolute_url(self): - return 'helpdesk:kb_category', (), {'slug': self.slug} - get_absolute_url = models.permalink(get_absolute_url) + from django.urls import reverse + return reverse('helpdesk:kb_category', kwargs={'slug': self.slug}) @python_2_unicode_compatible @@ -1038,8 +1038,8 @@ class KBItem(models.Model): verbose_name_plural = _('Knowledge base items') def get_absolute_url(self): - return 'helpdesk:kb_item', (self.id,) - get_absolute_url = models.permalink(get_absolute_url) + from django.urls import reverse + return reverse('helpdesk:kb_item', args=(self.id,)) @python_2_unicode_compatible diff --git a/helpdesk/templatetags/ticket_to_link.py b/helpdesk/templatetags/ticket_to_link.py index 772a3984..f62f590b 100644 --- a/helpdesk/templatetags/ticket_to_link.py +++ b/helpdesk/templatetags/ticket_to_link.py @@ -14,7 +14,7 @@ templatetags/ticket_to_link.py - Used in ticket comments to allow wiki-style import re from django import template -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.safestring import mark_safe from helpdesk.models import Ticket diff --git a/helpdesk/tests/helpers.py b/helpdesk/tests/helpers.py index 09055adc..efebe389 100644 --- a/helpdesk/tests/helpers.py +++ b/helpdesk/tests/helpers.py @@ -20,7 +20,7 @@ def get_staff_user(username='helpdesk.staff', password='password'): def reload_urlconf(urlconf=None): - from imp import reload # python 3 needs this import. + from importlib import reload # python 3 needs this import. if urlconf is None: from django.conf import settings @@ -33,7 +33,7 @@ def reload_urlconf(urlconf=None): if urlconf in sys.modules: reload(sys.modules[urlconf]) - from django.core.urlresolvers import clear_url_caches + from django.urls import clear_url_caches clear_url_caches() diff --git a/helpdesk/tests/test_attachments.py b/helpdesk/tests/test_attachments.py index dbc53d51..ebc6a8d9 100644 --- a/helpdesk/tests/test_attachments.py +++ b/helpdesk/tests/test_attachments.py @@ -6,7 +6,7 @@ import shutil from tempfile import gettempdir from django.core.files.uploadedfile import SimpleUploadedFile -from django.core.urlresolvers import reverse +from django.urls import reverse from django.test import override_settings, TestCase from django.utils.encoding import smart_text diff --git a/helpdesk/tests/test_navigation.py b/helpdesk/tests/test_navigation.py index 4ea6567f..1bde969a 100644 --- a/helpdesk/tests/test_navigation.py +++ b/helpdesk/tests/test_navigation.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from django.core.urlresolvers import reverse +from django.urls import reverse from django.test import TestCase from helpdesk.tests.helpers import get_staff_user, reload_urlconf @@ -23,7 +23,7 @@ class TestKBDisabled(TestCase): def test_navigation(self): """Test proper rendering of navigation.html by accessing the dashboard""" - from django.core.urlresolvers import NoReverseMatch + from django.urls import NoReverseMatch self.client.login(username=get_staff_user().get_username(), password='password') self.assertRaises(NoReverseMatch, reverse, 'helpdesk:kb_index') diff --git a/helpdesk/tests/test_per_queue_staff_permission.py b/helpdesk/tests/test_per_queue_staff_permission.py index 5e93ad9c..f1bd8be7 100644 --- a/helpdesk/tests/test_per_queue_staff_permission.py +++ b/helpdesk/tests/test_per_queue_staff_permission.py @@ -1,6 +1,6 @@ from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission -from django.core.urlresolvers import reverse +from django.urls import reverse from django.test import TestCase from django.test.client import Client diff --git a/helpdesk/tests/test_public_actions.py b/helpdesk/tests/test_public_actions.py index 38adc422..a88a1c8e 100644 --- a/helpdesk/tests/test_public_actions.py +++ b/helpdesk/tests/test_public_actions.py @@ -1,7 +1,7 @@ from helpdesk.models import Queue, Ticket from django.test import TestCase from django.test.client import Client -from django.core.urlresolvers import reverse +from django.urls import reverse class PublicActionsTestCase(TestCase): diff --git a/helpdesk/tests/test_savequery.py b/helpdesk/tests/test_savequery.py index 5aaa7086..8838b597 100644 --- a/helpdesk/tests/test_savequery.py +++ b/helpdesk/tests/test_savequery.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from django.core.urlresolvers import reverse +from django.urls import reverse from django.test import TestCase from helpdesk.models import Queue from helpdesk.tests.helpers import get_staff_user diff --git a/helpdesk/tests/test_ticket_actions.py b/helpdesk/tests/test_ticket_actions.py index 7058ca03..a5c82bf3 100644 --- a/helpdesk/tests/test_ticket_actions.py +++ b/helpdesk/tests/test_ticket_actions.py @@ -1,6 +1,6 @@ from django.contrib.auth import get_user_model from django.core import mail -from django.core.urlresolvers import reverse +from django.urls import reverse from django.test import TestCase from django.test.client import Client from helpdesk.models import CustomField, Queue, Ticket diff --git a/helpdesk/tests/test_ticket_lookup.py b/helpdesk/tests/test_ticket_lookup.py index d98406a1..fa2b516a 100644 --- a/helpdesk/tests/test_ticket_lookup.py +++ b/helpdesk/tests/test_ticket_lookup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from django.core.urlresolvers import reverse +from django.urls import reverse from django.test import TestCase from helpdesk.models import Ticket, Queue diff --git a/helpdesk/tests/test_ticket_submission.py b/helpdesk/tests/test_ticket_submission.py index a88c7121..e21cd4fb 100644 --- a/helpdesk/tests/test_ticket_submission.py +++ b/helpdesk/tests/test_ticket_submission.py @@ -2,7 +2,7 @@ from helpdesk.models import Queue, CustomField, Ticket from django.test import TestCase from django.core import mail from django.test.client import Client -from django.core.urlresolvers import reverse +from django.urls import reverse try: # python 3 from urllib.parse import urlparse diff --git a/helpdesk/tests/test_usersettings.py b/helpdesk/tests/test_usersettings.py index 25776ce9..67ed23f8 100644 --- a/helpdesk/tests/test_usersettings.py +++ b/helpdesk/tests/test_usersettings.py @@ -1,6 +1,6 @@ from django.contrib.auth import get_user_model from django.core import mail -from django.core.urlresolvers import reverse +from django.urls import reverse from django.test import TestCase from django.test.client import Client from helpdesk.models import CustomField, Queue, Ticket diff --git a/helpdesk/views/feeds.py b/helpdesk/views/feeds.py index 08fc74ef..aca10630 100644 --- a/helpdesk/views/feeds.py +++ b/helpdesk/views/feeds.py @@ -9,7 +9,7 @@ views/feeds.py - A handful of staff-only RSS feeds to provide ticket details from django.contrib.auth import get_user_model from django.contrib.syndication.views import Feed -from django.core.urlresolvers import reverse +from django.urls import reverse from django.db.models import Q from django.utils.translation import ugettext as _ from django.shortcuts import get_object_or_404 diff --git a/helpdesk/views/public.py b/helpdesk/views/public.py index f3f377e1..bde6a8ea 100644 --- a/helpdesk/views/public.py +++ b/helpdesk/views/public.py @@ -7,7 +7,7 @@ views/public.py - All public facing views, eg non-staff (no authentication required) views. """ from django.core.exceptions import ObjectDoesNotExist -from django.core.urlresolvers import reverse +from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from django.utils.http import urlquote diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index f3c00175..4bca4841 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -12,7 +12,7 @@ from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.decorators import user_passes_test -from django.core.urlresolvers import reverse +from django.urls import reverse from django.core.exceptions import ValidationError, PermissionDenied from django.db import connection from django.db.models import Q diff --git a/setup.py b/setup.py index 7a8923c4..a33e8fed 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from distutils.util import convert_path from fnmatch import fnmatchcase from setuptools import setup, find_packages -version = '0.2.5' +version = '0.2.6' # Provided as an attribute, so you can append to these instead # of replicating them: