Fix flake8 errors

This commit is contained in:
Tomas 2019-09-13 07:27:09 +02:00
parent 94ff6e1c3a
commit 965e1c12a9
2 changed files with 5 additions and 5 deletions

View file

@ -55,8 +55,8 @@ class MSFList(list):
super(MSFList, self).__init__(*args, **kwargs) super(MSFList, self).__init__(*args, **kwargs)
def __str__(msgl): def __str__(msgl):
l = [msgl.choices.get(int(i)) if i.isdigit() else msgl.choices.get(i) for i in msgl] msg_list = [msgl.choices.get(int(i)) if i.isdigit() else msgl.choices.get(i) for i in msgl]
return u', '.join([string_type(s) for s in l]) return u', '.join([string_type(s) for s in msg_list])
class MultiSelectField(models.CharField): class MultiSelectField(models.CharField):
@ -74,7 +74,7 @@ class MultiSelectField(models.CharField):
self.validators.append(MaxChoicesValidator(self.max_choices)) self.validators.append(MaxChoicesValidator(self.max_choices))
def _get_flatchoices(self): def _get_flatchoices(self):
l = super(MultiSelectField, self)._get_flatchoices() flat_choices = super(MultiSelectField, self)._get_flatchoices()
class MSFFlatchoices(list): class MSFFlatchoices(list):
# Used to trick django.contrib.admin.utils.display_for_field into # Used to trick django.contrib.admin.utils.display_for_field into
@ -83,7 +83,7 @@ class MultiSelectField(models.CharField):
def __bool__(self): def __bool__(self):
return False return False
__nonzero__ = __bool__ __nonzero__ = __bool__
return MSFFlatchoices(l) return MSFFlatchoices(flat_choices)
flatchoices = property(_get_flatchoices) flatchoices = property(_get_flatchoices)
def get_choices_default(self): def get_choices_default(self):

View file

@ -6,7 +6,7 @@ usedevelop = True
setenv = setenv =
PYTHONPATH=. PYTHONPATH=.
commands = commands =
python {envbindir}/flake8 --ignore=E501 python {envbindir}/flake8 --ignore=E501,W605
python {envbindir}/coverage run -p example/run_tests.py python {envbindir}/coverage run -p example/run_tests.py
python {envbindir}/coverage run -p example/run_tests.py example.settings_no_debug python {envbindir}/coverage run -p example/run_tests.py example.settings_no_debug
install_command = install_command =