diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 258: Fix pyflakes issues

Message ID 20111011103514.21793.45109.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki Oct. 11, 2011, 10:35 a.m. UTC
------------------------------------------------------------
revno: 258
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: trunk
timestamp: Tue 2011-10-11 11:58:00 +0200
message:
  Fix pyflakes issues
modified:
  lava_projects/models.py
  lava_projects/views.py
  lava_server/extension.py
  lava_server/settings/development.py
  lava_server/urls.py


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_projects/models.py'
--- lava_projects/models.py	2011-10-11 09:20:14 +0000
+++ lava_projects/models.py	2011-10-11 09:58:00 +0000
@@ -17,7 +17,6 @@ 
 # along with LAVA Server.  If not, see <http://www.gnu.org/licenses/>.
 
 from django.contrib.auth.models import User
-from django.core.exceptions import ObjectDoesNotExist
 from django.db import models
 from django.db.models.query import QuerySet
 from django.utils.translation import ugettext as _
@@ -42,9 +41,8 @@ 
             return self.get(identifier=identifier)
         except Project.DoesNotExist as no_such_project:
             try:
-                p_f_ir = ProjectFormerIdentifier.objects.get(
-                    former_identifier=identifier)
-                return p_f_i.project
+                return ProjectFormerIdentifier.objects.get(
+                    former_identifier=identifier).project
             except ProjectFormerIdentifier.DoesNotExist:
                 raise no_such_project
 

=== modified file 'lava_projects/views.py'
--- lava_projects/views.py	2011-10-11 09:20:14 +0000
+++ lava_projects/views.py	2011-10-11 09:58:00 +0000
@@ -18,11 +18,15 @@ 
 
 from django.contrib.auth.decorators import login_required
 from django.http import (
-    HttpResponse, HttpResponseRedirect, HttpResponseForbidden)
-from django.shortcuts import render_to_response, get_object_or_404
+    Http404,
+    HttpResponse,
+    HttpResponseForbidden,
+    HttpResponseRedirect,
+)
+from django.shortcuts import get_object_or_404
 from django.template import RequestContext, loader
 from django.utils.translation import ugettext as _
-from django.views.generic.list_detail import object_list, object_detail
+from django.views.generic.list_detail import object_list 
 
 from lava_server.bread_crumbs import (
     BreadCrumb,
@@ -184,7 +188,7 @@ 
         form = ProjectRenameForm(project, request.POST)
         if form.is_valid():
             # Remove old entry if we are reusing our older identifier
-            pfi = ProjectFormerIdentifier.objects.filter(
+            ProjectFormerIdentifier.objects.filter(
                 former_identifier=form.cleaned_data['identifier'],
                 project=project.pk).delete()
             # Record the change taking place

=== modified file 'lava_server/extension.py'
--- lava_server/extension.py	2011-10-11 09:20:14 +0000
+++ lava_server/extension.py	2011-10-11 09:58:00 +0000
@@ -264,7 +264,7 @@ 
         """
         try:
             extension_cls = entrypoint.load()
-        except ImportError as ex:
+        except ImportError:
             logging.exception(
                 "Unable to load extension entry point: %r", entrypoint)
             raise ExtensionLoadError(

=== modified file 'lava_server/settings/development.py'
--- lava_server/settings/development.py	2011-10-11 09:20:14 +0000
+++ lava_server/settings/development.py	2011-10-11 09:58:00 +0000
@@ -18,8 +18,6 @@ 
 
 import os
 
-from django.core.exceptions import ImproperlyConfigured
-
 from lava_server.extension import loader
 from lava_server.settings.common import *
 

=== modified file 'lava_server/urls.py'
--- lava_server/urls.py	2011-10-11 09:20:14 +0000
+++ lava_server/urls.py	2011-10-11 09:58:00 +0000
@@ -20,7 +20,6 @@ 
 from django.conf.urls.defaults import (
     handler404, handler500, include, patterns, url)
 from django.contrib import admin
-from django.views.generic.simple import direct_to_template
 from staticfiles.urls import staticfiles_urlpatterns
 from linaro_django_xmlrpc import urls as api_urls