diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-12-03 16:14:20 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:22 +0100 |
commit | 045bfe71586c0eeacf8a696d97ed5a136fb2cedf (patch) | |
tree | 5d658292ca339f6db9f6c4537850e352b0b26d99 /archaeological_warehouse | |
parent | d9844aa5f16efbdf82516bc00d473410bfe729f5 (diff) | |
download | Ishtar-045bfe71586c0eeacf8a696d97ed5a136fb2cedf.tar.bz2 Ishtar-045bfe71586c0eeacf8a696d97ed5a136fb2cedf.zip |
Container QA form: fix parent add - fix field layout (refs #4996 - refs #4997)
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r-- | archaeological_warehouse/forms.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 9ff09bde4..5fcc105cd 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -266,10 +266,10 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): associated_models = {'container_type': models.ContainerType, 'location': models.Warehouse, 'parent': models.Container} - reference = forms.CharField(label=_(u"Ref."), max_length=200) - old_reference = forms.CharField(label=_(u"Old reference"), required=False, + reference = forms.CharField(label=_("Ref."), max_length=200) + old_reference = forms.CharField(label=_("Old reference"), required=False, max_length=200) - container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) + container_type = forms.ChoiceField(label=_("Container type"), choices=[]) location = forms.IntegerField( label=_("Current location (warehouse)"), widget=widgets.JQueryAutoComplete( @@ -333,6 +333,7 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): dct['container_type'] = models.ContainerType.objects.get( pk=dct['container_type']) dct['location'] = models.Warehouse.objects.get(pk=dct['location']) + dct['parent'] = models.Container.objects.get(pk=dct['parent']) new_item = models.Container(**dct) new_item.save() return new_item |