Commit 2530735d authored by Alex Gaynor's avatar Alex Gaynor
Browse files

Fixed a number of flake8 errors -- particularly around unused imports and local variables

parent a9589dd2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ class RemoteUserMiddleware(object):
                        auth.BACKEND_SESSION_KEY, ''))
                    if isinstance(stored_backend, RemoteUserBackend):
                        auth.logout(request)
                except ImproperlyConfigured as e:
                except ImproperlyConfigured:
                    # backend failed to load
                    auth.logout(request)
            return
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ from django.core import validators
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils.crypto import get_random_string
from django.utils.http import urlquote
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
+1 −2
Original line number Diff line number Diff line
from __future__ import unicode_literals

from django import forms
from django.utils import six
from django.utils.translation import ugettext_lazy as _

# While this couples the geographic forms to the GEOS library,
@@ -85,7 +84,7 @@ class GeometryField(forms.Field):
        try:
            data = self.to_python(data)
            initial = self.to_python(initial)
        except ValidationError:
        except forms.ValidationError:
            return True

        # Only do a geographic comparison if both values are available
+0 −4
Original line number Diff line number Diff line
@@ -424,10 +424,6 @@ class FileSessionTests(SessionTestsMixin, unittest.TestCase):
        # Make sure the file backend checks for a good storage dir
        self.assertRaises(ImproperlyConfigured, self.backend)

    def test_invalid_key_backslash(self):
        # This key should be refused and a new session should be created
        self.assertTrue(self.backend("a\\b\\c").load())

    def test_invalid_key_backslash(self):
        # Ensure we don't allow directory-traversal.
        # This is tested directly on _key_to_file, as load() will swallow
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ def parse_backend_conf(backend, **kwargs):
    else:
        try:
            # Trying to import the given backend, in case it's a dotted path
            backend_cls = import_by_path(backend)
            import_by_path(backend)
        except ImproperlyConfigured as e:
            raise InvalidCacheBackendError("Could not find backend '%s': %s" % (
                backend, e))
Loading