From 142cb3316ec4135fd39fcfc1656cfd946a3cf9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DURR?= Date: Fri, 26 Aug 2022 22:33:21 +0200 Subject: [PATCH] Edited deprecated code Fixes #449 See : https://docs.djangoproject.com/en/3.2/ref/forms/api/\#notes-on-field-ordering --- subscription/views.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/subscription/views.py b/subscription/views.py index eff9d9cc..f92db2bc 100644 --- a/subscription/views.py +++ b/subscription/views.py @@ -68,9 +68,17 @@ class SubscriptionForm(forms.ModelForm): ) self.fields["email"] = forms.EmailField() self.fields["date_of_birth"] = forms.DateTimeField(widget=SelectDate) - self.fields.move_to_end("subscription_type") - self.fields.move_to_end("payment_method") - self.fields.move_to_end("location") + + self.field_order = [ + "member", + "last_name", + "first_name", + "email", + "date_of_birth", + "subscription_type", + "payment_method", + "location", + ] def clean_member(self): subscriber = self.cleaned_data.get("member")