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 | 349628574f0feec917f06048aaece627ce0f1571 (patch) | |
tree | 11a39a067c931ba8d1552de5608c55940df0976d /ishtar_common/forms.py | |
parent | eb0463882e369c53cb26956ac9dd50fa64eeddba (diff) | |
download | Ishtar-349628574f0feec917f06048aaece627ce0f1571.tar.bz2 Ishtar-349628574f0feec917f06048aaece627ce0f1571.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 |