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.

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.

SignupFormOnlyEmail

class userena.forms.SignupFormOnlyEmail(*args, **kwargs)

Form for creating a new user account but not needing a username.

This form is an adaptation of SignupForm. It’s used when USERENA_WITHOUT_USERNAME setting is set to True. And thus the user is not asked to supply an username, but one is generated for them. The user can than keep sign in by using their email.

save()

Generate a random username before falling back to parent signup form

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(*args, **kwargs)

A custom form 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 sign in 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

Previous topic

Decorators

Next topic

Managers

This Page