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): ...@@ -600,3 +600,35 @@ class EventCheckpointForm(forms.Form):
decimal_places=8, decimal_places=8,
widget=forms.HiddenInput(), 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 ...@@ -4,6 +4,7 @@ from aleksis.apps.postbuero.forms import MailAddForm
from . import views from . import views
from .forms import ( from .forms import (
RegisterAccountForm,
RegisterEventAccount, RegisterEventAccount,
RegisterEventAdditional, RegisterEventAdditional,
RegisterEventConsent, RegisterEventConsent,
...@@ -29,7 +30,7 @@ condition_dict = { ...@@ -29,7 +30,7 @@ condition_dict = {
account_forms = [ account_forms = [
("email", MailAddForm), ("email", MailAddForm),
("register", RegisterEventAccount), ("register", RegisterAccountForm),
] ]
account_conditions = { 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