summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-04-15 13:17:12 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:20 +0100
commitd20297193d978ab7e34bcbc03de91a1f7e191ff0 (patch)
tree128f885d5edef830d669466dccc3f313482aaa2e /archaeological_warehouse/forms.py
parent1d90e7c7001c21c9e8a5d1f3683c2acd1873973f (diff)
downloadIshtar-d20297193d978ab7e34bcbc03de91a1f7e191ff0.tar.bz2
Ishtar-d20297193d978ab7e34bcbc03de91a1f7e191ff0.zip
Fix warehouse division forms
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r--archaeological_warehouse/forms.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py
index 3e754b84a..fb345032e 100644
--- a/archaeological_warehouse/forms.py
+++ b/archaeological_warehouse/forms.py
@@ -61,25 +61,25 @@ def get_warehouse_field(label=_("Warehouse"), required=True):
class SelectedDivisionForm(ManageOldType, forms.Form):
form_label = _("Division")
base_model = 'associated_division'
- associated_models = {'division': models.ContainerType,
+ associated_models = {'container_type': models.ContainerType,
'associated_division': models.WarehouseDivisionLink}
- division = forms.ChoiceField(
+ container_type = forms.ChoiceField(
label=_("Container type"), choices=(),
validators=[valid_id(models.ContainerType)])
order = forms.IntegerField(label=_("Order"), min_value=0, required=False)
def __init__(self, *args, **kwargs):
super(SelectedDivisionForm, self).__init__(*args, **kwargs)
- self.fields['division'].choices = \
+ self.fields['container_type'].choices = \
models.ContainerType.get_types(
- initial=self.init_data.get('division')
- )
+ initial=self.init_data.get('container_type'))
class DivisionFormSet(FormSet):
def clean(self):
"""Checks that no divisions are duplicated."""
- self.check_duplicate(('division',), _("There are identical divisions."))
+ self.check_duplicate(('container_type',),
+ _("There are identical divisions."))
self.check_duplicate(('order',), _("Order fields must be different."),
check_null=True)