SignupForm
Form for completing social account signup when additional information is required.Inheritance
allauth.account.forms.BaseSignupForm with social account-specific functionality.
Constructor
SocialLogin
required
The
SocialLogin instance for the user being signed up. Must be passed as a keyword argument.bool
Whether email is required. Defaults to
SOCIALACCOUNT_EMAIL_REQUIRED setting.Attributes
SocialLogin
The social login instance associated with this signup.
Methods
save()
HttpRequest
The Django request object.
User
The newly created user instance.
- Calls the adapter’s
save_user()method - Invokes
custom_signup()hook for additional processing - Returns the saved user
validate_unique_email()
str
The email address to validate.
str
The validated email address.
ValidationErrorif the email is already taken, with a provider-specific error message.
Usage in Views
DisconnectForm
Form for disconnecting a social account from a user’s profile.Inheritance
Constructor
HttpRequest
required
The Django request object. Must be passed as a keyword argument.
Fields
ModelChoiceField
Radio select field for choosing which social account to disconnect.Widget:
Required: Yes
Queryset: Social accounts belonging to the current user
RadioSelectRequired: Yes
Queryset: Social accounts belonging to the current user
Attributes
HttpRequest
The Django request object.
QuerySet
QuerySet of the user’s social accounts.
Methods
clean()
dict
The cleaned form data.
ValidationErrorif disconnecting the account would leave the user unable to log in.
- User has a usable password, OR
- User has another connected social account, OR
- User has a verified email address
save()
- Validates the disconnection is safe
- Deletes the social account
- Sends
social_account_removedsignal - Sends notification email to user
