diff options
author | Stephen Finucane <stephen@that.guru> | 2018-06-24 20:55:51 +0100 |
---|---|---|
committer | Daniel Axtens <dja@axtens.net> | 2018-08-26 16:58:21 +1000 |
commit | 67bf1572dcedd06cc914e67a20cd19ab30dced44 (patch) | |
tree | 4a213eedd31412fde1ae8ee1fdc00984b0b5501a /patchwork/views | |
parent | e97bd5ca0e8e3334e8402a71af8ebc2342da83ef (diff) | |
download | patchwork-67bf1572dcedd06cc914e67a20cd19ab30dced44.tar patchwork-67bf1572dcedd06cc914e67a20cd19ab30dced44.tar.gz |
Remove compat wrapper for Django < 1.11
Deleting code is fun. We no longer need to carry these so don't.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Diffstat (limited to 'patchwork/views')
-rw-r--r-- | patchwork/views/__init__.py | 3 | ||||
-rw-r--r-- | patchwork/views/about.py | 3 | ||||
-rw-r--r-- | patchwork/views/bundle.py | 2 | ||||
-rw-r--r-- | patchwork/views/comment.py | 2 | ||||
-rw-r--r-- | patchwork/views/cover.py | 2 | ||||
-rw-r--r-- | patchwork/views/mail.py | 2 | ||||
-rw-r--r-- | patchwork/views/patch.py | 9 | ||||
-rw-r--r-- | patchwork/views/project.py | 2 | ||||
-rw-r--r-- | patchwork/views/user.py | 2 | ||||
-rw-r--r-- | patchwork/views/xmlrpc.py | 2 |
10 files changed, 13 insertions, 16 deletions
diff --git a/patchwork/views/__init__.py b/patchwork/views/__init__.py index f8d23a3..a30b3a6 100644 --- a/patchwork/views/__init__.py +++ b/patchwork/views/__init__.py @@ -20,7 +20,6 @@ from django.contrib import messages from django.shortcuts import get_object_or_404 -from patchwork.compat import is_authenticated from patchwork.filters import Filters from patchwork.forms import MultiplePatchForm from patchwork.models import Bundle @@ -230,7 +229,7 @@ def generic_list(request, project, view, view_args=None, filter_settings=None, user = request.user properties_form = None - if is_authenticated(user): + if user.is_authenticated: # we only pass the post data to the MultiplePatchForm if that was # the actual form submitted data_tmp = None diff --git a/patchwork/views/about.py b/patchwork/views/about.py index 24a0845..508dec3 100644 --- a/patchwork/views/about.py +++ b/patchwork/views/about.py @@ -21,8 +21,7 @@ from django.conf import settings from django.http import HttpResponsePermanentRedirect from django.shortcuts import render - -from patchwork.compat import reverse +from django.urls import reverse def about(request): diff --git a/patchwork/views/bundle.py b/patchwork/views/bundle.py index 5aa63fb..714062c 100644 --- a/patchwork/views/bundle.py +++ b/patchwork/views/bundle.py @@ -24,8 +24,8 @@ from django.http import HttpResponseRedirect from django.http import HttpResponseNotFound from django.shortcuts import get_object_or_404 from django.shortcuts import render +from django.urls import reverse -from patchwork.compat import reverse from patchwork.filters import DelegateFilter from patchwork.forms import BundleForm from patchwork.forms import DeleteBundleForm diff --git a/patchwork/views/comment.py b/patchwork/views/comment.py index 987f76c..c976322 100644 --- a/patchwork/views/comment.py +++ b/patchwork/views/comment.py @@ -19,8 +19,8 @@ from django import http from django import shortcuts +from django.urls import reverse -from patchwork.compat import reverse from patchwork import models diff --git a/patchwork/views/cover.py b/patchwork/views/cover.py index 73f83cb..f18a262 100644 --- a/patchwork/views/cover.py +++ b/patchwork/views/cover.py @@ -22,8 +22,8 @@ from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render_to_response +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import CoverLetter from patchwork.models import Submission from patchwork.views.utils import cover_to_mbox diff --git a/patchwork/views/mail.py b/patchwork/views/mail.py index 8afd83b..aca7ab1 100644 --- a/patchwork/views/mail.py +++ b/patchwork/views/mail.py @@ -24,8 +24,8 @@ from django.core.mail import send_mail from django.http import HttpResponseRedirect from django.shortcuts import render from django.template.loader import render_to_string +from django.urls import reverse -from patchwork.compat import reverse from patchwork.forms import EmailForm from patchwork.models import EmailConfirmation from patchwork.models import EmailOptout diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index cbd4ec3..6921882 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -24,9 +24,8 @@ from django.http import HttpResponseForbidden from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render +from django.urls import reverse -from patchwork.compat import reverse -from patchwork.compat import is_authenticated from patchwork.forms import CreateBundleForm from patchwork.forms import PatchForm from patchwork.models import Bundle @@ -43,7 +42,7 @@ def patch_list(request, project_id): context = generic_list(request, project, 'patch-list', view_args={'project_id': project.linkname}) - if is_authenticated(request.user): + if request.user.is_authenticated: context['bundles'] = request.user.bundles.all() return render(request, 'patchwork/list.html', context) @@ -70,7 +69,7 @@ def patch_detail(request, patch_id): if editable: form = PatchForm(instance=patch) - if is_authenticated(request.user): + if request.user.is_authenticated: createbundleform = CreateBundleForm() if request.method == 'POST': @@ -111,7 +110,7 @@ def patch_detail(request, patch_id): form.save() messages.success(request, 'Patch updated') - if is_authenticated(request.user): + if request.user.is_authenticated: context['bundles'] = request.user.bundles.all() context['submission'] = patch diff --git a/patchwork/views/project.py b/patchwork/views/project.py index 484455c..a2e5b2d 100644 --- a/patchwork/views/project.py +++ b/patchwork/views/project.py @@ -22,8 +22,8 @@ from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import Patch from patchwork.models import Project diff --git a/patchwork/views/user.py b/patchwork/views/user.py index 4a4958a..8dcb407 100644 --- a/patchwork/views/user.py +++ b/patchwork/views/user.py @@ -28,8 +28,8 @@ from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.template.loader import render_to_string +from django.urls import reverse -from patchwork.compat import reverse from patchwork.filters import DelegateFilter from patchwork.forms import EmailForm from patchwork.forms import RegistrationForm diff --git a/patchwork/views/xmlrpc.py b/patchwork/views/xmlrpc.py index 93f6035..b02a65b 100644 --- a/patchwork/views/xmlrpc.py +++ b/patchwork/views/xmlrpc.py @@ -35,11 +35,11 @@ from django.http import HttpResponse from django.http import HttpResponseRedirect from django.http import HttpResponseServerError from django.views.decorators.csrf import csrf_exempt +from django.urls import reverse from django.utils import six from django.utils.six.moves import xmlrpc_client from django.utils.six.moves.xmlrpc_server import SimpleXMLRPCDispatcher -from patchwork.compat import reverse from patchwork.models import Check from patchwork.models import Patch from patchwork.models import Person |