Skip to content

Commit

Permalink
Merge branch 'master' into drop_unsupported_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasgarzon authored Sep 19, 2019
2 parents 679a6e4 + d3868c3 commit 8f5581d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -42,3 +42,4 @@ notifications:
email:
- [email protected]
- [email protected]
- [email protected]
8 changes: 4 additions & 4 deletions multiselectfield/db/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def __init__(self, choices, *args, **kwargs):
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):
Expand All @@ -74,7 +74,7 @@ def __init__(self, *args, **kwargs):
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
Expand All @@ -83,7 +83,7 @@ class MSFFlatchoices(list):
def __bool__(self):
return False
__nonzero__ = __bool__
return MSFFlatchoices(choices)
return MSFFlatchoices(flat_choices)
flatchoices = property(_get_flatchoices)

def get_choices_default(self):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 8f5581d

Please sign in to comment.