Fix PEP8 violations

This commit is contained in:
Swen Kooij 2017-06-26 11:33:25 +03:00
parent 06873afbda
commit 3b28a5e707
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ env/
# Ignore Python byte code cache # Ignore Python byte code cache
*.pyc *.pyc
__pycache__ __pycache__
.cache/
# Ignore coverage reports # Ignore coverage reports
.coverage .coverage

View File

@ -5,7 +5,6 @@ from .fields import LocalizedField, LocalizedCharField, LocalizedTextField, \
LocalizedFileField LocalizedFileField
FORMFIELD_FOR_LOCALIZED_FIELDS_DEFAULTS = { FORMFIELD_FOR_LOCALIZED_FIELDS_DEFAULTS = {
LocalizedField: {'widget': widgets.AdminLocalizedFieldWidget}, LocalizedField: {'widget': widgets.AdminLocalizedFieldWidget},
LocalizedCharField: {'widget': widgets.AdminLocalizedCharFieldWidget}, LocalizedCharField: {'widget': widgets.AdminLocalizedCharFieldWidget},

View File

@ -88,7 +88,7 @@ class LocalizedFileFieldForm(LocalizedFieldForm, forms.FileField):
def clean(self, value, initial=None): def clean(self, value, initial=None):
""" """
Most part of this method is a copy of Most part of this method is a copy of
django.forms.MultiValueField.clean, with the exception of initial django.forms.MultiValueField.clean, with the exception of initial
value handling (this need for correct processing FileField's). value handling (this need for correct processing FileField's).
All original comments saved. All original comments saved.
@ -121,8 +121,9 @@ class LocalizedFileFieldForm(LocalizedFieldForm, forms.FileField):
field_initial = initial[i] field_initial = initial[i]
except IndexError: except IndexError:
field_initial = None field_initial = None
if field_value in self.empty_values and \ if field_value in self.empty_values and \
field_initial in self.empty_values: field_initial in self.empty_values:
if self.require_all_fields: if self.require_all_fields:
# Raise a 'required' error if the MultiValueField is # Raise a 'required' error if the MultiValueField is
# required and any field is empty. # required and any field is empty.