]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
trivial: Cleanup imports in views
authorStephen Finucane <stephen@that.guru>
Tue, 7 Feb 2017 11:25:30 +0000 (11:25 +0000)
committerStephen Finucane <stephen@that.guru>
Tue, 4 Apr 2017 14:11:34 +0000 (15:11 +0100)
Break each import onto its own line and remove 'absolute_import'
imports, which aren't necessary for Python >= 2.7.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Daniel Axtens <dja@axtens.net>
patchwork/views/api.py
patchwork/views/bundle.py
patchwork/views/comment.py
patchwork/views/cover.py
patchwork/views/patch.py
patchwork/views/project.py
patchwork/views/pwclient.py
patchwork/views/user.py

index 4d79f931e5f0dc39540f99d22fee3a7b9e2a82e3..bdd2a69248807318889482af8ae2833bc42d2bb5 100644 (file)
@@ -22,7 +22,8 @@ import json
 from django.db.models import Q
 from django.http import HttpResponse
 
-from patchwork.models import Person, User
+from patchwork.models import Person
+from patchwork.models import User
 
 
 MINIMUM_CHARACTERS = 3
index f752094f86d8a88082974b9958c4c4bf6d97ff23..3e8d034989cdeb411cbfd902c69aec16c5a50895 100644 (file)
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from __future__ import absolute_import
-
 from django.conf import settings
 from django.contrib.auth.decorators import login_required
-import django.core.urlresolvers
-from django.http import (HttpResponse, HttpResponseRedirect,
-                         HttpResponseNotFound)
-from django.shortcuts import render, get_object_or_404
+from django.core import urlresolvers
+from django.http import HttpResponse
+from django.http import HttpResponseRedirect
+from django.http import HttpResponseNotFound
+from django.shortcuts import get_object_or_404
+from django.shortcuts import render
 
 from patchwork.filters import DelegateFilter
-from patchwork.forms import BundleForm, DeleteBundleForm
-from patchwork.models import Bundle, BundlePatch, Project
+from patchwork.forms import BundleForm
+from patchwork.forms import DeleteBundleForm
+from patchwork.models import Bundle
+from patchwork.models import BundlePatch
+from patchwork.models import Project
 from patchwork.views import generic_list
 from patchwork.views.utils import patch_to_mbox
 
@@ -87,7 +90,7 @@ def bundle_detail(request, username, bundlename):
             if action == 'delete':
                 bundle.delete()
                 return HttpResponseRedirect(
-                    django.core.urlresolvers.reverse('user-profile')
+                    urlresolvers.reverse('user-profile')
                 )
             elif action == 'update':
                 form = BundleForm(request.POST, instance=bundle)
@@ -161,7 +164,7 @@ def bundle_detail_redir(request, bundle_id):
 @login_required
 def bundle_mbox_redir(request, bundle_id):
     bundle = get_object_or_404(Bundle, id=bundle_id, owner=request.user)
-    return HttpResponseRedirect(django.core.urlresolvers.reverse(
+    return HttpResponseRedirect(urlresolvers.reverse(
                                 'bundle-mbox', kwargs={
                                     'username': request.user.username,
                                     'bundlename': bundle.name,
index 71751052b1e3b654e70ec464db42d3b2e4e96eff..e4f4f8988874cd7389264ba75a96afdfd152740c 100644 (file)
@@ -17,8 +17,6 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from __future__ import absolute_import
-
 from django.core import urlresolvers
 from django import http
 from django import shortcuts
index fe3eaf2c4ccea7d8422a843f17e727ed85ae38c5..af1b2f2f4a9e1c317bb00e9adb316b5cfe938be9 100644 (file)
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from __future__ import absolute_import
-
 from django.core import urlresolvers
 from django.http import Http404
 from django.http import HttpResponseRedirect
-from django.shortcuts import render_to_response, get_object_or_404
+from django.shortcuts import get_object_or_404
+from django.shortcuts import render_to_response
 
-from patchwork.models import CoverLetter, Submission
+from patchwork.models import CoverLetter
+from patchwork.models import Submission
 
 
 def cover_detail(request, cover_id):
index d1e81d114a72ad7db2661b5a4cdbf971b7d655c5..a4cea2fe60192e33373ca92d6391d3485ec0e922 100644 (file)
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from __future__ import absolute_import
-
 from django.contrib import messages
 from django.core import urlresolvers
 from django.http import Http404
 from django.http import HttpResponse
 from django.http import HttpResponseForbidden
 from django.http import HttpResponseRedirect
-from django.shortcuts import render, get_object_or_404
-
-from patchwork.forms import PatchForm, CreateBundleForm
-from patchwork.models import Patch, Project, Bundle, Submission
+from django.shortcuts import get_object_or_404
+from django.shortcuts import render
+
+from patchwork.forms import CreateBundleForm
+from patchwork.forms import PatchForm
+from patchwork.models import Bundle
+from patchwork.models import Patch
+from patchwork.models import Project
+from patchwork.models import Submission
 from patchwork.views import generic_list
 from patchwork.views.utils import patch_to_mbox
 
index de0c67d90f3c117bc06d5f2936fb261b6a070d08..618480547e2a59d65544b47ee084b2302ba0658e 100644 (file)
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from __future__ import absolute_import
-
 from django.conf import settings
 from django.contrib.auth.models import User
 from django.core import urlresolvers
 from django.http import HttpResponseRedirect
-from django.shortcuts import get_object_or_404, render
+from django.shortcuts import get_object_or_404
+from django.shortcuts import render
 
 from patchwork.models import Patch
 from patchwork.models import Project
index 64fb04486f55cea50e8dbbe5f041b03bcb3762aa..c5dc806121497dd0be29dfeef867382f5b2d4b3c 100644 (file)
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from __future__ import absolute_import
-
 from django.conf import settings
-from django.shortcuts import get_object_or_404, render
+from django.shortcuts import get_object_or_404
+from django.shortcuts import render
 
 from patchwork.models import Project
 
index c182aa3458478141119fb83e54ec6fddfdc12096..7c290876c36b2c0853c183d6c31499d752133e03 100644 (file)
@@ -26,7 +26,8 @@ from django.conf import settings
 from django.core.mail import send_mail
 from django.core import urlresolvers
 from django.http import HttpResponseRedirect
-from django.shortcuts import render, get_object_or_404
+from django.shortcuts import get_object_or_404
+from django.shortcuts import render
 
 from patchwork.compat import render_to_string
 from patchwork.filters import DelegateFilter