From: Stephen Finucane Date: Tue, 7 Feb 2017 11:25:30 +0000 (+0000) Subject: trivial: Cleanup imports in views X-Git-Tag: v2.0.0-rc1~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd99cce784e7d36dfe13bb9d7c5360d8842a7835;p=thirdparty%2Fpatchwork.git trivial: Cleanup imports in views 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 Reviewed-by: Daniel Axtens --- diff --git a/patchwork/views/api.py b/patchwork/views/api.py index 4d79f931..bdd2a692 100644 --- a/patchwork/views/api.py +++ b/patchwork/views/api.py @@ -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 diff --git a/patchwork/views/bundle.py b/patchwork/views/bundle.py index f752094f..3e8d0349 100644 --- a/patchwork/views/bundle.py +++ b/patchwork/views/bundle.py @@ -17,18 +17,21 @@ # 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, diff --git a/patchwork/views/comment.py b/patchwork/views/comment.py index 71751052..e4f4f898 100644 --- a/patchwork/views/comment.py +++ b/patchwork/views/comment.py @@ -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 diff --git a/patchwork/views/cover.py b/patchwork/views/cover.py index fe3eaf2c..af1b2f2f 100644 --- a/patchwork/views/cover.py +++ b/patchwork/views/cover.py @@ -17,14 +17,14 @@ # 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): diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index d1e81d11..a4cea2fe 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -17,18 +17,21 @@ # 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 diff --git a/patchwork/views/project.py b/patchwork/views/project.py index de0c67d9..61848054 100644 --- a/patchwork/views/project.py +++ b/patchwork/views/project.py @@ -17,13 +17,12 @@ # 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 diff --git a/patchwork/views/pwclient.py b/patchwork/views/pwclient.py index 64fb0448..c5dc8061 100644 --- a/patchwork/views/pwclient.py +++ b/patchwork/views/pwclient.py @@ -17,10 +17,9 @@ # 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 diff --git a/patchwork/views/user.py b/patchwork/views/user.py index c182aa34..7c290876 100644 --- a/patchwork/views/user.py +++ b/patchwork/views/user.py @@ -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