Fix govplan proposal form

This commit is contained in:
Stefan Wehrmeyer 2022-03-18 11:25:01 +01:00
parent 196f5a2cc7
commit b77275147f

View file

@ -97,10 +97,12 @@ class GovernmentPlanUpdateProposalForm(forms.ModelForm):
choices=[("", "---")] + PlanStatus.choices, choices=[("", "---")] + PlanStatus.choices,
required=False, required=False,
) )
rating = forms.ChoiceField( rating = forms.TypedChoiceField(
label=_("rating"), label=_("rating"),
help_text=_("What's your rating of the current implementation?"), help_text=_("What's your rating of the current implementation?"),
choices=[("", "---")] + PlanRating.choices, choices=[("", "---")] + PlanRating.choices,
coerce=int,
empty_value="",
required=False, required=False,
) )
@ -128,5 +130,5 @@ class GovernmentPlanUpdateProposalForm(forms.ModelForm):
"data": data, "data": data,
"timestamp": timezone.now().isoformat(), "timestamp": timezone.now().isoformat(),
} }
plan.save() plan.save(update_fields=["proposals"])
return plan return plan