Merge 0.2.6 Django 2.0 updates

This commit is contained in:
Garret Wassermann 2017-12-28 09:16:01 -05:00
commit 3ccd6c8dc8
18 changed files with 26 additions and 26 deletions

View File

@ -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'

View File

@ -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
from django.contrib.auth.decorators import user_passes_test

View File

@ -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

View File

@ -529,7 +529,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:
@ -549,7 +549,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:
@ -582,8 +582,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:
@ -971,8 +971,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
@ -1039,8 +1039,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

View File

@ -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

View File

@ -35,7 +35,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()

View File

@ -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

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import sys
from importlib import reload
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test import TestCase
from helpdesk import settings as helpdesk_settings
@ -23,7 +23,7 @@ class KBDisabledTestCase(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')

View File

@ -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

View File

@ -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):

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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