Skip to content
Snippets Groups Projects
Commit 3d9991ae authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Merge branch 'tt_dupl_form' into 'master'

feat: Duplicate form for account registration

See merge request !75
parents b645f6c3 b1ce678e
No related branches found
No related tags found
1 merge request!75feat: Duplicate form for account registration
Pipeline #194795 passed
......@@ -600,3 +600,35 @@ class EventCheckpointForm(forms.Form):
decimal_places=8,
widget=forms.HiddenInput(),
)
class RegisterAccountForm(SignupForm, ExtensibleForm):
"""Form to register new user accounts."""
class Meta:
model = EventRegistration
fields = []
layout = Layout(
Fieldset(
_("Base data"),
Row("first_name", "last_name", "date_of_birth"),
),
Fieldset(
_("Account data"),
"username",
Row("email", "email2"),
Row("password1", "password2"),
),
)
first_name = forms.CharField(label=_("First name"))
last_name = forms.CharField(label=_("Last name"))
date_of_birth = forms.DateField(label=_("Date of birth"))
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["username"].help_text = _(
"The username must only contain lower case letters and numbers, "
"and must begin with a letter."
)
......@@ -4,6 +4,7 @@ from aleksis.apps.postbuero.forms import MailAddForm
from . import views
from .forms import (
RegisterAccountForm,
RegisterEventAccount,
RegisterEventAdditional,
RegisterEventConsent,
......@@ -29,7 +30,7 @@ condition_dict = {
account_forms = [
("email", MailAddForm),
("register", RegisterEventAccount),
("register", RegisterAccountForm),
]
account_conditions = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment