Commit d588a65d authored by Arkadiusz Hiler's avatar Arkadiusz Hiler
Browse files

Use django.urls instead of django.core.urlresolvers



Deprecated since forever, gone with newer Django.
Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent c95d1856
......@@ -29,7 +29,7 @@ from django.conf import settings
from django.contrib import auth
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.db import models
from django.db.models import Q
import django.dispatch
......
......@@ -20,7 +20,7 @@
from __future__ import absolute_import
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
from django.urls import reverse, NoReverseMatch
from django import template
from django.utils.encoding import smart_str
from django.utils.html import escape
......
......@@ -19,7 +19,7 @@
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.urls import reverse
from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
......
......@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test import TestCase
from patchwork.models import EmailConfirmation, Person
......
......@@ -22,7 +22,7 @@ from __future__ import absolute_import
import datetime
import re
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test import TestCase
from django.utils.six.moves import zip
......
......@@ -20,7 +20,7 @@
import re
from django.core import mail
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test import TestCase
from patchwork.models import EmailOptout, EmailConfirmation, Person
......
......@@ -19,7 +19,7 @@
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test.client import Client
from django.test import TestCase
......
......@@ -17,7 +17,7 @@
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test import TestCase
from patchwork.models import Patch, Person, State
......
......@@ -21,7 +21,7 @@ import base64
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test import TestCase
from patchwork.models import EmailConfirmation, Person, Bundle, UserProfile
......
......@@ -23,7 +23,7 @@ import unittest
from django.utils.six.moves.urllib.parse import urlparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.test import LiveServerTestCase
from django.utils.six.moves import xmlrpc_client
......
......@@ -22,7 +22,7 @@ from __future__ import absolute_import
import json
from django.conf import settings
from django.core import urlresolvers
from django.urls import reverse
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render, get_object_or_404
......@@ -37,8 +37,7 @@ def projects(request):
if projects.count() == 1:
return HttpResponseRedirect(
urlresolvers.reverse('patch_list',
kwargs={'project_id': projects[0].linkname}))
reverse('patch_list', kwargs={'project_id': projects[0].linkname}))
return render(request, 'patchwork/projects.html', {'projects': projects})
......
......@@ -19,7 +19,7 @@
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from django.http import (HttpResponse, HttpResponseRedirect,
HttpResponseNotFound)
......
......@@ -21,7 +21,7 @@ from __future__ import absolute_import
from django.conf import settings as conf_settings
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.contrib.sites.models import Site
from django.http import HttpResponseRedirect
from django.shortcuts import render
......
......@@ -24,7 +24,7 @@ from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.conf import settings
from django.core.mail import send_mail
from django.core import urlresolvers
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.template.loader import render_to_string
......@@ -179,7 +179,7 @@ def unlink(request, person_id):
person.user = None
person.save()
url = urlresolvers.reverse('user')
url = reverse('user')
return HttpResponseRedirect(url)
......@@ -202,7 +202,7 @@ def todo_lists(request):
if len(todo_lists) == 1:
return HttpResponseRedirect(
urlresolvers.reverse('todo_list',
reverse('todo_list',
kwargs={'project_id': todo_lists[0]['project'].linkname}))
context = {'todo_lists': todo_lists,
......
......@@ -32,7 +32,7 @@ import sys
import patchwork.threadlocalrequest
from django.core import urlresolvers
from django.urls import reverse
from django.contrib.auth import authenticate
from django.http import (
HttpResponse, HttpResponseRedirect, HttpResponseServerError)
......@@ -143,7 +143,7 @@ dispatcher = PatchworkXMLRPCDispatcher()
@csrf_exempt
def xmlrpc(request):
if request.method not in ['POST', 'GET']:
return HttpResponseRedirect(urlresolvers.reverse(
return HttpResponseRedirect(reverse(
'help', kwargs={'path': 'pwclient/'}))
response = HttpResponse()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment