Compensation control

* removes CompensationControl model
* adds comment field to CompensationAction
* adds max length of 200 for comment fields in forms
* adds rendering of error messages in case of invalid form input
* adds/updates translations
This commit is contained in:
mipel
2021-08-04 11:56:56 +02:00
parent d5db80562d
commit d7c95c9e70
9 changed files with 91 additions and 97 deletions
+5 -2
View File
@@ -178,9 +178,10 @@ class NewDeadlineModalForm(BaseModalForm):
)
comment = forms.CharField(
required=False,
max_length=200,
label=_("Comment"),
label_suffix=_(""),
help_text=_("Additional comment"),
help_text=_("Additional comment, maximum {} letters").format(200),
widget=forms.Textarea(
attrs={
"cols": 30,
@@ -239,9 +240,10 @@ class NewActionModalForm(BaseModalForm):
)
comment = forms.CharField(
required=False,
max_length=200,
label=_("Comment"),
label_suffix=_(""),
help_text=_("Additional comment"),
help_text=_("Additional comment, maximum {} letters").format(200),
widget=forms.Textarea(
attrs={
"cols": 30,
@@ -265,6 +267,7 @@ class NewActionModalForm(BaseModalForm):
action_type=self.cleaned_data["action_type"],
amount=self.cleaned_data["amount"],
unit=self.cleaned_data["unit"],
comment=self.cleaned_data["comment"],
created=user_action,
)
self.instance.actions.add(comp_action)