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 | |
| parent | 670d74c9506fc8e8d5aabc4a217ddbf386e291ec (diff) | |
| download | Ishtar-7d5d412dc193e74346838aa0f2ae440c1c652cff.tar.bz2 Ishtar-7d5d412dc193e74346838aa0f2ae440c1c652cff.zip  | |
Warehouse location form: division is required
| -rw-r--r-- | archaeological_warehouse/forms.py | 2 | ||||
| -rw-r--r-- | ishtar_common/forms.py | 10 | 
2 files changed, 6 insertions, 6 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 2dc963ca0..2df03c036 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -53,7 +53,7 @@ class SelectedDivisionForm(ManageOldType, forms.Form):      associated_models = {'division': models.WarehouseDivision,                           'associated_division': models.WarehouseDivisionLink}      division = forms.ChoiceField( -        label=_(u"Division"), choices=(), required=False, +        label=_(u"Division"), choices=(),          validators=[valid_id(models.WarehouseDivision)])      order = forms.IntegerField(_(u"Order"), initial=10, required=False) 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  | 
