diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-22 10:29:27 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-22 10:29:27 +0100 |
commit | 7d5d412dc193e74346838aa0f2ae440c1c652cff (patch) | |
tree | 11a39a067c931ba8d1552de5608c55940df0976d /ishtar_common/forms.py | |
parent | 670d74c9506fc8e8d5aabc4a217ddbf386e291ec (diff) | |
download | Ishtar-7d5d412dc193e74346838aa0f2ae440c1c652cff.tar.bz2 Ishtar-7d5d412dc193e74346838aa0f2ae440c1c652cff.zip |
Warehouse location form: division is required
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r-- | ishtar_common/forms.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 7b98021d6..c0dbc6d7f 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -431,7 +431,7 @@ class FormSet(CustomForm, BaseFormSet): if not [v for v in item if v]: continue if item in items: - raise forms.ValidationError, error_msg + raise forms.ValidationError(error_msg) items.append(item) def add_fields(self, form, index): @@ -456,10 +456,10 @@ class FormSet(CustomForm, BaseFormSet): if form.cleaned_data.get(DELETION_FIELD_NAME, False): return True if not form.cleaned_data or not [ - __ for __ in form.cleaned_data - if __ != DELETION_FIELD_NAME and - form.cleaned_data[__] is not None and - form.cleaned_data[__] != '']: + key for key in form.cleaned_data + if key != DELETION_FIELD_NAME and + form.cleaned_data[key] is not None and + form.cleaned_data[key] != '']: form.cleaned_data[DELETION_FIELD_NAME] = True return True return False |