Commit 2cd2d188 authored by Tim Graham's avatar Tim Graham
Browse files

Fixed W503 flake8 warnings.

parent d356bb65
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -51,9 +51,8 @@ def check_dependencies(**kwargs):
        pass
    else:
        if ('django.contrib.auth.context_processors.auth'
                not in default_template_engine.context_processors
                and 'django.contrib.auth.backends.ModelBackend'
                in settings.AUTHENTICATION_BACKENDS):
                not in default_template_engine.context_processors and
                'django.contrib.auth.backends.ModelBackend' in settings.AUTHENTICATION_BACKENDS):
            missing_template = checks.Error(
                "'django.contrib.auth.context_processors.auth' must be in "
                "TEMPLATES in order to use the admin application.",
@@ -801,8 +800,8 @@ class ModelAdminChecks(BaseModelAdminChecks):
                ]
            # If list_display[0] is in list_editable, check that
            # list_display_links is set. See #22792 and #26229 for use cases.
            elif (obj.list_display[0] == field_name and not obj.list_display_links
                    and obj.list_display_links is not None):
            elif (obj.list_display[0] == field_name and not obj.list_display_links and
                    obj.list_display_links is not None):
                return [
                    checks.Error(
                        "The value of '%s' refers to the first field in 'list_display' ('%s'), "
+1 −2
Original line number Diff line number Diff line
@@ -386,8 +386,7 @@ class AllValuesFieldListFilter(FieldListFilter):

    def choices(self, changelist):
        yield {
            'selected': (self.lookup_val is None
                and self.lookup_val_isnull is None),
            'selected': self.lookup_val is None and self.lookup_val_isnull is None,
            'query_string': changelist.get_query_string({},
                [self.lookup_kwarg, self.lookup_kwarg_isnull]),
            'display': _('All'),
+1 −2
Original line number Diff line number Diff line
@@ -672,8 +672,7 @@ class ModelAdmin(BaseModelAdmin):
            "formfield_callback": partial(self.formfield_for_dbfield, request=request),
        }
        defaults.update(kwargs)
        if (defaults.get('fields') is None
                and not modelform_defines_fields(defaults.get('form'))):
        if defaults.get('fields') is None and not modelform_defines_fields(defaults.get('form')):
            defaults['fields'] = forms.ALL_FIELDS

        return modelform_factory(self.model, **defaults)
+1 −2
Original line number Diff line number Diff line
@@ -241,8 +241,7 @@ class ChangeList(object):
        ordering field.
        """
        params = self.params
        ordering = list(self.model_admin.get_ordering(request)
                        or self._get_default_ordering())
        ordering = list(self.model_admin.get_ordering(request) or self._get_default_ordering())
        if ORDER_VAR in params:
            # Clear ordering and used params
            ordering = []
+1 −2
Original line number Diff line number Diff line
@@ -261,8 +261,7 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
        # also handles it (#25524).
        if handle_spheroid and len(dist_val) > 1:
            option = dist_val[1]
            if (not geography and geodetic and lookup_type != 'dwithin'
                    and option == 'spheroid'):
            if not geography and geodetic and lookup_type != 'dwithin' and option == 'spheroid':
                # using distance_spheroid requires the spheroid of the field as
                # a parameter.
                params.insert(0, f._spheroid)
Loading