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: script:
- coverage erase - 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
- PYTHONPATH=. coverage run -p example/run_tests.py example.settings_no_debug - PYTHONPATH=. coverage run -p example/run_tests.py example.settings_no_debug
after_success: after_success:
@ -42,3 +42,4 @@ notifications:
email: email:
- goinnn@gmail.com - goinnn@gmail.com
- blag@users.noreply.github.com - blag@users.noreply.github.com
- tomasgarzonhervas@gmail.com

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):
list = [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 list]) 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):
choices = 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(choices) 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 =