Merge branch 'master' into drop_unsupported_versions

This commit is contained in:
tomasgarzon 2019-09-19 06:51:45 +02:00 committed by GitHub
commit 8f5581d715
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -31,7 +31,7 @@ install:
script:
- coverage erase
- if [[ $(python -c 'import sys; print("0" if sys.version_info < (2, 7) else "1")') == "1" ]]; then flake8 --ignore=E501; fi
- if [[ $(python -c 'import sys; print("0" if sys.version_info < (2, 7) else "1")') == "1" ]]; then flake8 --ignore=E501,W605; fi
- PYTHONPATH=. coverage run -p example/run_tests.py
- PYTHONPATH=. coverage run -p example/run_tests.py example.settings_no_debug
after_success:
@ -42,3 +42,4 @@ notifications:
email:
- goinnn@gmail.com
- blag@users.noreply.github.com
- tomasgarzonhervas@gmail.com

View file

@ -55,8 +55,8 @@ class MSFList(list):
super(MSFList, self).__init__(*args, **kwargs)
def __str__(msgl):
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 list])
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 msg_list])
class MultiSelectField(models.CharField):
@ -74,7 +74,7 @@ class MultiSelectField(models.CharField):
self.validators.append(MaxChoicesValidator(self.max_choices))
def _get_flatchoices(self):
choices = super(MultiSelectField, self)._get_flatchoices()
flat_choices = super(MultiSelectField, self)._get_flatchoices()
class MSFFlatchoices(list):
# Used to trick django.contrib.admin.utils.display_for_field into
@ -83,7 +83,7 @@ class MultiSelectField(models.CharField):
def __bool__(self):
return False
__nonzero__ = __bool__
return MSFFlatchoices(choices)
return MSFFlatchoices(flat_choices)
flatchoices = property(_get_flatchoices)
def get_choices_default(self):

View file

@ -6,7 +6,7 @@ usedevelop = True
setenv =
PYTHONPATH=.
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 example.settings_no_debug
install_command =