From b77275147f48497574c40743fd57b24c53aa6da2 Mon Sep 17 00:00:00 2001 From: Stefan Wehrmeyer Date: Fri, 18 Mar 2022 11:25:01 +0100 Subject: [PATCH] Fix govplan proposal form --- froide_govplan/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/froide_govplan/forms.py b/froide_govplan/forms.py index 8854cce..1a477e7 100644 --- a/froide_govplan/forms.py +++ b/froide_govplan/forms.py @@ -97,10 +97,12 @@ class GovernmentPlanUpdateProposalForm(forms.ModelForm): choices=[("", "---")] + PlanStatus.choices, required=False, ) - rating = forms.ChoiceField( + rating = forms.TypedChoiceField( label=_("rating"), help_text=_("What's your rating of the current implementation?"), choices=[("", "---")] + PlanRating.choices, + coerce=int, + empty_value="", required=False, ) @@ -128,5 +130,5 @@ class GovernmentPlanUpdateProposalForm(forms.ModelForm): "data": data, "timestamp": timezone.now().isoformat(), } - plan.save() + plan.save(update_fields=["proposals"]) return plan