democrasite.users.adapters module¶
This module contains adapters for the allauth package.
The adapters are used to customize the behavior of allauth accounts. These are used to allow disabling local and social account registration via settings.
- class democrasite.users.adapters.AccountAdapter(request=None)¶
Bases:
DefaultAccountAdapterAdapter for accounts, overwritten to allow disabling local account registration with a setting
- is_open_for_signup(request: HttpRequest)¶
Checks whether or not the site is open for signups.
Next to simply returning True/False you can also intervene the regular flow by raising an ImmediateHttpResponse
- class democrasite.users.adapters.SocialAccountAdapter(request=None)¶
Bases:
DefaultSocialAccountAdapterAdapter for social accounts, overwritten to allow disabling social account registration with a setting