Commit 9bf72ea9 authored by Thom Wiggers's avatar Thom Wiggers 📐 Committed by Sébastiaan Versteeg
Browse files

Merge branch 'feature/registrations-starting-year-widget' into 'master'

Make starting year a dropdown in registration form

Closes #667

See merge request !869

(cherry picked from commit ccd627fe)

bd405422 Make starting year a dropdown in registration form
parent 9af698b0
"""The forms defined by the registrations package"""
from django import forms
from django.forms import TypedChoiceField
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from utils.snippets import datetime_to_lectureyear
from .models import Registration, Renewal
......@@ -20,6 +22,16 @@ class MemberRegistrationForm(forms.ModelForm):
label=_('I accept the privacy policy')
this_year = datetime_to_lectureyear(
years = reversed([(x, "{} - {}".format(x, x + 1)) for x in
range(this_year - 20, this_year + 1)])
starting_year = TypedChoiceField(
class Meta:
model = Registration
fields = '__all__'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment