We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Unexpected description/clarification on form field in registration form
### Describe the bug

On the page to register as a Thalia member, there is a form field with an explanation/clarification saying 'Warning: changing this in the admin does not update the contribution.' Please see the screenshot below.

### How to reproduce

Go to the ['Become a Member'](https://thalia.nu/association/register/member/) page. You'll see it :)

### Expected behaviour

That the text would not be there.

### Screenshots

![image](https://github.com/svthalia/concrexit/assets/9899175/8dfcdc16-e248-4872-a4af-86563bcc81dd)

### Additional context

N/A


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `website/registrations/forms.py`
Content:
```
1 from django import forms
2 from django.conf import settings
3 from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
4 from django.forms import HiddenInput, TypedChoiceField
5 from django.urls import reverse_lazy
6 from django.utils import timezone
7 from django.utils.safestring import mark_safe
8 from django.utils.text import capfirst
9 from django.utils.translation import gettext_lazy as _
10 
11 from members.models import Membership
12 from payments.widgets import SignatureWidget
13 from registrations import services
14 
15 from .models import Reference, Registration, Renewal
16 
17 
18 class BaseRegistrationForm(forms.ModelForm):
19     """Base form for membership registrations.
20 
21     Subclasses must implement setting the right contribution.
22     """
23 
24     birthday = forms.DateField(
25         label=capfirst(_("birthday")),
26     )
27 
28     privacy_policy = forms.BooleanField(
29         required=True,
30     )
31 
32     direct_debit = forms.BooleanField(
33         required=False,
34         label=_("Pay via direct debit"),
35         help_text=_(
36             "This will allow you to sign a Direct Debit mandate, allowing Thalia to withdraw the membership fees from your bank account. Also, you will be able to use this bank account for future payments to Thalia via Thalia Pay."
37         ),
38     )
39 
40     contribution = forms.DecimalField(required=False, widget=HiddenInput())
41 
42     def __init__(self, *args, **kwargs):
43         super().__init__(*args, **kwargs)
44         self.fields["privacy_policy"].label = mark_safe(
45             _('I accept the <a href="{}">privacy policy</a>.').format(
46                 reverse_lazy("singlepages:privacy-policy")
47             )
48         )
49         self.fields["birthday"].widget.input_type = "date"
50 
51     def clean(self):
52         if self.cleaned_data.get("phone_number") is not None:  # pragma: no cover
53             self.cleaned_data["phone_number"] = self.cleaned_data[
54                 "phone_number"
55             ].replace(" ", "")
56         super().clean()
57 
58 
59 class RegistrationAdminForm(forms.ModelForm):
60     """Custom admin form for Registration model to add the widget for the signature."""
61 
62     class Meta:
63         fields = "__all__"
64         model = Registration
65         widgets = {
66             "signature": SignatureWidget(),
67         }
68 
69 
70 class MemberRegistrationForm(BaseRegistrationForm):
71     """Form for member registrations."""
72 
73     this_year = timezone.now().year
74     years = reversed(
75         [(x, f"{x} - {x + 1}") for x in range(this_year - 20, this_year + 1)]
76     )
77 
78     starting_year = TypedChoiceField(
79         choices=years,
80         coerce=int,
81         empty_value=this_year,
82         required=False,
83         help_text=_("What lecture year did you start studying at Radboud University?"),
84     )
85 
86     def __init__(self, *args, **kwargs):
87         super().__init__(*args, **kwargs)
88         self.fields["student_number"].required = True
89         self.fields["programme"].required = True
90         self.fields["starting_year"].required = True
91 
92     class Meta:
93         model = Registration
94         widgets = {"signature": SignatureWidget()}
95         fields = (
96             "length",
97             "first_name",
98             "last_name",
99             "birthday",
100             "email",
101             "phone_number",
102             "student_number",
103             "programme",
104             "starting_year",
105             "address_street",
106             "address_street2",
107             "address_postal_code",
108             "address_city",
109             "address_country",
110             "optin_birthday",
111             "optin_mailinglist",
112             "contribution",
113             "membership_type",
114             "direct_debit",
115             "initials",
116             "iban",
117             "bic",
118             "signature",
119         )
120 
121     def clean(self):
122         super().clean()
123         self.cleaned_data["contribution"] = settings.MEMBERSHIP_PRICES[
124             self.cleaned_data["length"]
125         ]
126 
127         return self.cleaned_data
128 
129 
130 class BenefactorRegistrationForm(BaseRegistrationForm):
131     """Form for benefactor registrations."""
132 
133     icis_employee = forms.BooleanField(
134         required=False, label=_("I am an employee of iCIS")
135     )
136 
137     contribution = forms.DecimalField(
138         required=True,
139         max_digits=5,
140         decimal_places=2,
141     )
142 
143     class Meta:
144         model = Registration
145         widgets = {
146             "signature": SignatureWidget(),
147         }
148         fields = (
149             "length",
150             "first_name",
151             "last_name",
152             "birthday",
153             "email",
154             "phone_number",
155             "student_number",
156             "address_street",
157             "address_street2",
158             "address_postal_code",
159             "address_city",
160             "address_country",
161             "optin_birthday",
162             "optin_mailinglist",
163             "contribution",
164             "membership_type",
165             "direct_debit",
166             "initials",
167             "iban",
168             "bic",
169             "signature",
170         )
171 
172 
173 class RenewalForm(forms.ModelForm):
174     """Form for membership renewals."""
175 
176     privacy_policy = forms.BooleanField(
177         required=True,
178     )
179 
180     icis_employee = forms.BooleanField(
181         required=False, label=_("I am an employee of iCIS")
182     )
183 
184     contribution = forms.DecimalField(
185         required=False,
186         max_digits=5,
187         decimal_places=2,
188     )
189 
190     def __init__(self, *args, **kwargs):
191         super().__init__(*args, **kwargs)
192         self.fields["privacy_policy"].label = mark_safe(
193             _('I accept the <a href="{}">privacy policy</a>.').format(
194                 reverse_lazy("singlepages:privacy-policy")
195             )
196         )
197         self.fields["length"].help_text = (
198             "A discount of €7,50 will be applied if you upgrade your (active) year membership "
199             "to a membership until graduation. You will only have to pay €22,50 in that case."
200         )
201 
202     class Meta:
203         model = Renewal
204         fields = (
205             "member",
206             "length",
207             "contribution",
208             "membership_type",
209             "no_references",
210             "remarks",
211         )
212 
213     def clean(self):
214         super().clean()
215         if self.cleaned_data["member"].profile.is_minimized:
216             raise ValidationError(
217                 "It's not possible to renew a membership using an incomplete profile."
218             )
219 
220         if self.cleaned_data["length"] == Renewal.MEMBERSHIP_STUDY:
221             now = timezone.now()
222             if Membership.objects.filter(
223                 user=self.cleaned_data["member"],
224                 type=Membership.MEMBER,
225                 until__gte=now,
226                 since__lte=now,
227             ).exists():
228                 # The membership upgrade discount applies if, at the time a Renewal is
229                 # created, the user has an active 'member' type membership for a year.
230                 self.cleaned_data["contribution"] = (
231                     settings.MEMBERSHIP_PRICES[Renewal.MEMBERSHIP_STUDY]
232                     - settings.MEMBERSHIP_PRICES[Renewal.MEMBERSHIP_YEAR]
233                 )
234             else:
235                 self.cleaned_data["contribution"] = settings.MEMBERSHIP_PRICES[
236                     Renewal.MEMBERSHIP_STUDY
237                 ]
238         elif self.cleaned_data["membership_type"] == Membership.MEMBER:
239             self.cleaned_data["contribution"] = settings.MEMBERSHIP_PRICES[
240                 self.cleaned_data["length"]
241             ]
242 
243         return self.cleaned_data
244 
245 
246 class ReferenceForm(forms.ModelForm):
247     def clean(self):
248         super().clean()
249         membership = self.cleaned_data["member"].current_membership
250         if membership and membership.type == Membership.BENEFACTOR:
251             raise ValidationError(_("Benefactors cannot give references."))
252 
253         membership = self.cleaned_data["member"].latest_membership
254         if (
255             membership
256             and membership.until
257             and membership.until < services.calculate_membership_since()
258         ):
259             raise ValidationError(
260                 "It's not possible to give references for memberships "
261                 "that start after your own membership's end."
262             )
263 
264     class Meta:
265         model = Reference
266         fields = "__all__"
267         error_messages = {
268             NON_FIELD_ERRORS: {
269                 "unique_together": _(
270                     "You've already given a reference for this person."
271                 ),
272             }
273         }
274
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/website/registrations/forms.py b/website/registrations/forms.py
--- a/website/registrations/forms.py
+++ b/website/registrations/forms.py
@@ -47,6 +47,7 @@
             )
         )
         self.fields["birthday"].widget.input_type = "date"
+        self.fields["length"].help_text = None
 
     def clean(self):
         if self.cleaned_data.get("phone_number") is not None:  # pragma: no cover

{"golden_diff": "diff --git a/website/registrations/forms.py b/website/registrations/forms.py\n--- a/website/registrations/forms.py\n+++ b/website/registrations/forms.py\n@@ -47,6 +47,7 @@\n             )\n         )\n         self.fields[\"birthday\"].widget.input_type = \"date\"\n+        self.fields[\"length\"].help_text = None\n \n     def clean(self):\n         if self.cleaned_data.get(\"phone_number\") is not None:  # pragma: no cover\n", "issue": "Unexpected description/clarification on form field in registration form\n### Describe the bug\r\n\r\nOn the page to register as a Thalia member, there is a form field with an explanation/clarification saying 'Warning: changing this in the admin does not update the contribution.' Please see the screenshot below.\r\n\r\n### How to reproduce\r\n\r\nGo to the ['Become a Member'](https://thalia.nu/association/register/member/) page. You'll see it :)\r\n\r\n### Expected behaviour\r\n\r\nThat the text would not be there.\r\n\r\n### Screenshots\r\n\r\n![image](https://github.com/svthalia/concrexit/assets/9899175/8dfcdc16-e248-4872-a4af-86563bcc81dd)\r\n\r\n### Additional context\r\n\r\nN/A\r\n\n", "before_files": [{"content": "from django import forms\nfrom django.conf import settings\nfrom django.core.exceptions import NON_FIELD_ERRORS, ValidationError\nfrom django.forms import HiddenInput, TypedChoiceField\nfrom django.urls import reverse_lazy\nfrom django.utils import timezone\nfrom django.utils.safestring import mark_safe\nfrom django.utils.text import capfirst\nfrom django.utils.translation import gettext_lazy as _\n\nfrom members.models import Membership\nfrom payments.widgets import SignatureWidget\nfrom registrations import services\n\nfrom .models import Reference, Registration, Renewal\n\n\nclass BaseRegistrationForm(forms.ModelForm):\n    \"\"\"Base form for membership registrations.\n\n    Subclasses must implement setting the right contribution.\n    \"\"\"\n\n    birthday = forms.DateField(\n        label=capfirst(_(\"birthday\")),\n    )\n\n    privacy_policy = forms.BooleanField(\n        required=True,\n    )\n\n    direct_debit = forms.BooleanField(\n        required=False,\n        label=_(\"Pay via direct debit\"),\n        help_text=_(\n            \"This will allow you to sign a Direct Debit mandate, allowing Thalia to withdraw the membership fees from your bank account. Also, you will be able to use this bank account for future payments to Thalia via Thalia Pay.\"\n        ),\n    )\n\n    contribution = forms.DecimalField(required=False, widget=HiddenInput())\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.fields[\"privacy_policy\"].label = mark_safe(\n            _('I accept the <a href=\"{}\">privacy policy</a>.').format(\n                reverse_lazy(\"singlepages:privacy-policy\")\n            )\n        )\n        self.fields[\"birthday\"].widget.input_type = \"date\"\n\n    def clean(self):\n        if self.cleaned_data.get(\"phone_number\") is not None:  # pragma: no cover\n            self.cleaned_data[\"phone_number\"] = self.cleaned_data[\n                \"phone_number\"\n            ].replace(\" \", \"\")\n        super().clean()\n\n\nclass RegistrationAdminForm(forms.ModelForm):\n    \"\"\"Custom admin form for Registration model to add the widget for the signature.\"\"\"\n\n    class Meta:\n        fields = \"__all__\"\n        model = Registration\n        widgets = {\n            \"signature\": SignatureWidget(),\n        }\n\n\nclass MemberRegistrationForm(BaseRegistrationForm):\n    \"\"\"Form for member registrations.\"\"\"\n\n    this_year = timezone.now().year\n    years = reversed(\n        [(x, f\"{x} - {x + 1}\") for x in range(this_year - 20, this_year + 1)]\n    )\n\n    starting_year = TypedChoiceField(\n        choices=years,\n        coerce=int,\n        empty_value=this_year,\n        required=False,\n        help_text=_(\"What lecture year did you start studying at Radboud University?\"),\n    )\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.fields[\"student_number\"].required = True\n        self.fields[\"programme\"].required = True\n        self.fields[\"starting_year\"].required = True\n\n    class Meta:\n        model = Registration\n        widgets = {\"signature\": SignatureWidget()}\n        fields = (\n            \"length\",\n            \"first_name\",\n            \"last_name\",\n            \"birthday\",\n            \"email\",\n            \"phone_number\",\n            \"student_number\",\n            \"programme\",\n            \"starting_year\",\n            \"address_street\",\n            \"address_street2\",\n            \"address_postal_code\",\n            \"address_city\",\n            \"address_country\",\n            \"optin_birthday\",\n            \"optin_mailinglist\",\n            \"contribution\",\n            \"membership_type\",\n            \"direct_debit\",\n            \"initials\",\n            \"iban\",\n            \"bic\",\n            \"signature\",\n        )\n\n    def clean(self):\n        super().clean()\n        self.cleaned_data[\"contribution\"] = settings.MEMBERSHIP_PRICES[\n            self.cleaned_data[\"length\"]\n        ]\n\n        return self.cleaned_data\n\n\nclass BenefactorRegistrationForm(BaseRegistrationForm):\n    \"\"\"Form for benefactor registrations.\"\"\"\n\n    icis_employee = forms.BooleanField(\n        required=False, label=_(\"I am an employee of iCIS\")\n    )\n\n    contribution = forms.DecimalField(\n        required=True,\n        max_digits=5,\n        decimal_places=2,\n    )\n\n    class Meta:\n        model = Registration\n        widgets = {\n            \"signature\": SignatureWidget(),\n        }\n        fields = (\n            \"length\",\n            \"first_name\",\n            \"last_name\",\n            \"birthday\",\n            \"email\",\n            \"phone_number\",\n            \"student_number\",\n            \"address_street\",\n            \"address_street2\",\n            \"address_postal_code\",\n            \"address_city\",\n            \"address_country\",\n            \"optin_birthday\",\n            \"optin_mailinglist\",\n            \"contribution\",\n            \"membership_type\",\n            \"direct_debit\",\n            \"initials\",\n            \"iban\",\n            \"bic\",\n            \"signature\",\n        )\n\n\nclass RenewalForm(forms.ModelForm):\n    \"\"\"Form for membership renewals.\"\"\"\n\n    privacy_policy = forms.BooleanField(\n        required=True,\n    )\n\n    icis_employee = forms.BooleanField(\n        required=False, label=_(\"I am an employee of iCIS\")\n    )\n\n    contribution = forms.DecimalField(\n        required=False,\n        max_digits=5,\n        decimal_places=2,\n    )\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.fields[\"privacy_policy\"].label = mark_safe(\n            _('I accept the <a href=\"{}\">privacy policy</a>.').format(\n                reverse_lazy(\"singlepages:privacy-policy\")\n            )\n        )\n        self.fields[\"length\"].help_text = (\n            \"A discount of \u20ac7,50 will be applied if you upgrade your (active) year membership \"\n            \"to a membership until graduation. You will only have to pay \u20ac22,50 in that case.\"\n        )\n\n    class Meta:\n        model = Renewal\n        fields = (\n            \"member\",\n            \"length\",\n            \"contribution\",\n            \"membership_type\",\n            \"no_references\",\n            \"remarks\",\n        )\n\n    def clean(self):\n        super().clean()\n        if self.cleaned_data[\"member\"].profile.is_minimized:\n            raise ValidationError(\n                \"It's not possible to renew a membership using an incomplete profile.\"\n            )\n\n        if self.cleaned_data[\"length\"] == Renewal.MEMBERSHIP_STUDY:\n            now = timezone.now()\n            if Membership.objects.filter(\n                user=self.cleaned_data[\"member\"],\n                type=Membership.MEMBER,\n                until__gte=now,\n                since__lte=now,\n            ).exists():\n                # The membership upgrade discount applies if, at the time a Renewal is\n                # created, the user has an active 'member' type membership for a year.\n                self.cleaned_data[\"contribution\"] = (\n                    settings.MEMBERSHIP_PRICES[Renewal.MEMBERSHIP_STUDY]\n                    - settings.MEMBERSHIP_PRICES[Renewal.MEMBERSHIP_YEAR]\n                )\n            else:\n                self.cleaned_data[\"contribution\"] = settings.MEMBERSHIP_PRICES[\n                    Renewal.MEMBERSHIP_STUDY\n                ]\n        elif self.cleaned_data[\"membership_type\"] == Membership.MEMBER:\n            self.cleaned_data[\"contribution\"] = settings.MEMBERSHIP_PRICES[\n                self.cleaned_data[\"length\"]\n            ]\n\n        return self.cleaned_data\n\n\nclass ReferenceForm(forms.ModelForm):\n    def clean(self):\n        super().clean()\n        membership = self.cleaned_data[\"member\"].current_membership\n        if membership and membership.type == Membership.BENEFACTOR:\n            raise ValidationError(_(\"Benefactors cannot give references.\"))\n\n        membership = self.cleaned_data[\"member\"].latest_membership\n        if (\n            membership\n            and membership.until\n            and membership.until < services.calculate_membership_since()\n        ):\n            raise ValidationError(\n                \"It's not possible to give references for memberships \"\n                \"that start after your own membership's end.\"\n            )\n\n    class Meta:\n        model = Reference\n        fields = \"__all__\"\n        error_messages = {\n            NON_FIELD_ERRORS: {\n                \"unique_together\": _(\n                    \"You've already given a reference for this person.\"\n                ),\n            }\n        }\n", "path": "website/registrations/forms.py"}], "after_files": [{"content": "from django import forms\nfrom django.conf import settings\nfrom django.core.exceptions import NON_FIELD_ERRORS, ValidationError\nfrom django.forms import HiddenInput, TypedChoiceField\nfrom django.urls import reverse_lazy\nfrom django.utils import timezone\nfrom django.utils.safestring import mark_safe\nfrom django.utils.text import capfirst\nfrom django.utils.translation import gettext_lazy as _\n\nfrom members.models import Membership\nfrom payments.widgets import SignatureWidget\nfrom registrations import services\n\nfrom .models import Reference, Registration, Renewal\n\n\nclass BaseRegistrationForm(forms.ModelForm):\n    \"\"\"Base form for membership registrations.\n\n    Subclasses must implement setting the right contribution.\n    \"\"\"\n\n    birthday = forms.DateField(\n        label=capfirst(_(\"birthday\")),\n    )\n\n    privacy_policy = forms.BooleanField(\n        required=True,\n    )\n\n    direct_debit = forms.BooleanField(\n        required=False,\n        label=_(\"Pay via direct debit\"),\n        help_text=_(\n            \"This will allow you to sign a Direct Debit mandate, allowing Thalia to withdraw the membership fees from your bank account. Also, you will be able to use this bank account for future payments to Thalia via Thalia Pay.\"\n        ),\n    )\n\n    contribution = forms.DecimalField(required=False, widget=HiddenInput())\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.fields[\"privacy_policy\"].label = mark_safe(\n            _('I accept the <a href=\"{}\">privacy policy</a>.').format(\n                reverse_lazy(\"singlepages:privacy-policy\")\n            )\n        )\n        self.fields[\"birthday\"].widget.input_type = \"date\"\n        self.fields[\"length\"].help_text = None\n\n    def clean(self):\n        if self.cleaned_data.get(\"phone_number\") is not None:  # pragma: no cover\n            self.cleaned_data[\"phone_number\"] = self.cleaned_data[\n                \"phone_number\"\n            ].replace(\" \", \"\")\n        super().clean()\n\n\nclass RegistrationAdminForm(forms.ModelForm):\n    \"\"\"Custom admin form for Registration model to add the widget for the signature.\"\"\"\n\n    class Meta:\n        fields = \"__all__\"\n        model = Registration\n        widgets = {\n            \"signature\": SignatureWidget(),\n        }\n\n\nclass MemberRegistrationForm(BaseRegistrationForm):\n    \"\"\"Form for member registrations.\"\"\"\n\n    this_year = timezone.now().year\n    years = reversed(\n        [(x, f\"{x} - {x + 1}\") for x in range(this_year - 20, this_year + 1)]\n    )\n\n    starting_year = TypedChoiceField(\n        choices=years,\n        coerce=int,\n        empty_value=this_year,\n        required=False,\n        help_text=_(\"What lecture year did you start studying at Radboud University?\"),\n    )\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.fields[\"student_number\"].required = True\n        self.fields[\"programme\"].required = True\n        self.fields[\"starting_year\"].required = True\n\n    class Meta:\n        model = Registration\n        widgets = {\"signature\": SignatureWidget()}\n        fields = (\n            \"length\",\n            \"first_name\",\n            \"last_name\",\n            \"birthday\",\n            \"email\",\n            \"phone_number\",\n            \"student_number\",\n            \"programme\",\n            \"starting_year\",\n            \"address_street\",\n            \"address_street2\",\n            \"address_postal_code\",\n            \"address_city\",\n            \"address_country\",\n            \"optin_birthday\",\n            \"optin_mailinglist\",\n            \"contribution\",\n            \"membership_type\",\n            \"direct_debit\",\n            \"initials\",\n            \"iban\",\n            \"bic\",\n            \"signature\",\n        )\n\n    def clean(self):\n        super().clean()\n        self.cleaned_data[\"contribution\"] = settings.MEMBERSHIP_PRICES[\n            self.cleaned_data[\"length\"]\n        ]\n\n        return self.cleaned_data\n\n\nclass BenefactorRegistrationForm(BaseRegistrationForm):\n    \"\"\"Form for benefactor registrations.\"\"\"\n\n    icis_employee = forms.BooleanField(\n        required=False, label=_(\"I am an employee of iCIS\")\n    )\n\n    contribution = forms.DecimalField(\n        required=True,\n        max_digits=5,\n        decimal_places=2,\n    )\n\n    class Meta:\n        model = Registration\n        widgets = {\n            \"signature\": SignatureWidget(),\n        }\n        fields = (\n            \"length\",\n            \"first_name\",\n            \"last_name\",\n            \"birthday\",\n            \"email\",\n            \"phone_number\",\n            \"student_number\",\n            \"address_street\",\n            \"address_street2\",\n            \"address_postal_code\",\n            \"address_city\",\n            \"address_country\",\n            \"optin_birthday\",\n            \"optin_mailinglist\",\n            \"contribution\",\n            \"membership_type\",\n            \"direct_debit\",\n            \"initials\",\n            \"iban\",\n            \"bic\",\n            \"signature\",\n        )\n\n\nclass RenewalForm(forms.ModelForm):\n    \"\"\"Form for membership renewals.\"\"\"\n\n    privacy_policy = forms.BooleanField(\n        required=True,\n    )\n\n    icis_employee = forms.BooleanField(\n        required=False, label=_(\"I am an employee of iCIS\")\n    )\n\n    contribution = forms.DecimalField(\n        required=False,\n        max_digits=5,\n        decimal_places=2,\n    )\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.fields[\"privacy_policy\"].label = mark_safe(\n            _('I accept the <a href=\"{}\">privacy policy</a>.').format(\n                reverse_lazy(\"singlepages:privacy-policy\")\n            )\n        )\n        self.fields[\"length\"].help_text = (\n            \"A discount of \u20ac7,50 will be applied if you upgrade your (active) year membership \"\n            \"to a membership until graduation. You will only have to pay \u20ac22,50 in that case.\"\n        )\n\n    class Meta:\n        model = Renewal\n        fields = (\n            \"member\",\n            \"length\",\n            \"contribution\",\n            \"membership_type\",\n            \"no_references\",\n            \"remarks\",\n        )\n\n    def clean(self):\n        super().clean()\n        if self.cleaned_data[\"member\"].profile.is_minimized:\n            raise ValidationError(\n                \"It's not possible to renew a membership using an incomplete profile.\"\n            )\n\n        if self.cleaned_data[\"length\"] == Renewal.MEMBERSHIP_STUDY:\n            now = timezone.now()\n            if Membership.objects.filter(\n                user=self.cleaned_data[\"member\"],\n                type=Membership.MEMBER,\n                until__gte=now,\n                since__lte=now,\n            ).exists():\n                # The membership upgrade discount applies if, at the time a Renewal is\n                # created, the user has an active 'member' type membership for a year.\n                self.cleaned_data[\"contribution\"] = (\n                    settings.MEMBERSHIP_PRICES[Renewal.MEMBERSHIP_STUDY]\n                    - settings.MEMBERSHIP_PRICES[Renewal.MEMBERSHIP_YEAR]\n                )\n            else:\n                self.cleaned_data[\"contribution\"] = settings.MEMBERSHIP_PRICES[\n                    Renewal.MEMBERSHIP_STUDY\n                ]\n        elif self.cleaned_data[\"membership_type\"] == Membership.MEMBER:\n            self.cleaned_data[\"contribution\"] = settings.MEMBERSHIP_PRICES[\n                self.cleaned_data[\"length\"]\n            ]\n\n        return self.cleaned_data\n\n\nclass ReferenceForm(forms.ModelForm):\n    def clean(self):\n        super().clean()\n        membership = self.cleaned_data[\"member\"].current_membership\n        if membership and membership.type == Membership.BENEFACTOR:\n            raise ValidationError(_(\"Benefactors cannot give references.\"))\n\n        membership = self.cleaned_data[\"member\"].latest_membership\n        if (\n            membership\n            and membership.until\n            and membership.until < services.calculate_membership_since()\n        ):\n            raise ValidationError(\n                \"It's not possible to give references for memberships \"\n                \"that start after your own membership's end.\"\n            )\n\n    class Meta:\n        model = Reference\n        fields = \"__all__\"\n        error_messages = {\n            NON_FIELD_ERRORS: {\n                \"unique_together\": _(\n                    \"You've already given a reference for this person.\"\n                ),\n            }\n        }\n", "path": "website/registrations/forms.py"}]}