Forms

Return to API Reference.

SignupForm

class userena.forms.SignupForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False)

Form for creating a new user account.

Validates that the requested username and e-mail is not already in use. Also requires the password to be entered twice and the Terms of Service to be accepted.

clean()

Validates that the values entered into the two password fields match. Note that an error here will end up in non_field_errors() because it doesn’t apply to a single field.

clean_email()

Validate that the e-mail address is unique.

clean_username()

Validate that the username is alphanumeric and is not already in use. Also validates that the username is not listed in USERENA_FORBIDDEN_USERNAMES list.

save()

Creates a new user and account. Returns the newly created user.

SignupFormTos

class userena.forms.SignupFormTos(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False)

Add a Terms of Service button to the SignupForm.

AuthenticationForm

class userena.forms.AuthenticationForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False)

A custom AuthenticationForm where the identification can be a e-mail address or username.

clean()

Checks for the identification and password.

If the combination can’t be found will raise an invalid signin error.

ChangeEmailForm

class userena.forms.ChangeEmailForm(user, *args, **kwargs)
clean_email()

Validate that the email is not already registered with another user

save()

Save method calls user.change_email() method which sends out an email with an verification key to verify and with it enable this new email address.

EditProfileForm

class userena.forms.EditProfileForm(*args, **kw)

Base form used for fields that are always required

Table Of Contents

This Page