mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-25 07:50:40 +03:00
* Create a test matrix on Travis CI to help testing multiple options * Change test_docker.sh to fail if any command in it fails * Run black on the CI with --check option * Fix formatting of project files using black * Install black in the docker container * Exclude migrations in black checks * Fix Black formatting violations * Run black on the whole generated project & fix issues
17 lines
595 B
Python
17 lines
595 B
Python
from typing import Any
|
|
|
|
from allauth.account.adapter import DefaultAccountAdapter
|
|
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
|
|
from django.conf import settings
|
|
from django.http import HttpRequest
|
|
|
|
|
|
class AccountAdapter(DefaultAccountAdapter):
|
|
def is_open_for_signup(self, request: HttpRequest):
|
|
return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True)
|
|
|
|
|
|
class SocialAccountAdapter(DefaultSocialAccountAdapter):
|
|
def is_open_for_signup(self, request: HttpRequest, sociallogin: Any):
|
|
return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True)
|