8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-24 04:13:12 +00:00

fix: Deposit creation form translations

This commit is contained in:
Jean-Romain Garnier 2021-08-07 13:31:16 +02:00
parent 7b5d21c6b1
commit 7ecfb35925

View file

@ -40,6 +40,11 @@ class DepositForm(FormRevMixin, ModelForm):
user = kwargs.pop("user")
super(DepositForm, self).__init__(*args, **kwargs)
# Set the fields' label to handle translation
self.fields["item"].label = _("Deposit item")
self.fields["payment_method"].label = _("Payment method")
self.fields["returned"].label = _("Deposit returned")
if creation:
# During creation, we only need to select the item and payment
# method, no need to add the "returned" checkbox
@ -47,8 +52,6 @@ class DepositForm(FormRevMixin, ModelForm):
"item": self.fields["item"],
"payment_method": self.fields["payment_method"],
}
else:
self.fields["returned"].label = _("Deposit returned")
class Meta:
model = Deposit