mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-24 12:23:11 +00:00
fix: Deposit creation form translations
This commit is contained in:
parent
7b5d21c6b1
commit
7ecfb35925
1 changed files with 5 additions and 2 deletions
|
@ -40,6 +40,11 @@ class DepositForm(FormRevMixin, ModelForm):
|
||||||
user = kwargs.pop("user")
|
user = kwargs.pop("user")
|
||||||
super(DepositForm, self).__init__(*args, **kwargs)
|
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:
|
if creation:
|
||||||
# During creation, we only need to select the item and payment
|
# During creation, we only need to select the item and payment
|
||||||
# method, no need to add the "returned" checkbox
|
# method, no need to add the "returned" checkbox
|
||||||
|
@ -47,8 +52,6 @@ class DepositForm(FormRevMixin, ModelForm):
|
||||||
"item": self.fields["item"],
|
"item": self.fields["item"],
|
||||||
"payment_method": self.fields["payment_method"],
|
"payment_method": self.fields["payment_method"],
|
||||||
}
|
}
|
||||||
else:
|
|
||||||
self.fields["returned"].label = _("Deposit returned")
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Deposit
|
model = Deposit
|
||||||
|
|
Loading…
Reference in a new issue