mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-16 01:44:51 +03:00
Add docstring for populate_user
This commit is contained in:
parent
541f09ab55
commit
e29bd6f2b7
|
@ -15,7 +15,10 @@ class SocialAccountAdapter(DefaultSocialAccountAdapter):
|
||||||
def is_open_for_signup(self, request: HttpRequest, sociallogin: Any):
|
def is_open_for_signup(self, request: HttpRequest, sociallogin: Any):
|
||||||
return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True)
|
return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True)
|
||||||
|
|
||||||
def populate_user(self, request, sociallogin, data):
|
"""
|
||||||
|
Populates user information from social provider info
|
||||||
|
See: https://django-allauth.readthedocs.io/en/latest/advanced.html?highlight=populate_user#creating-and-populating-user-instances
|
||||||
|
"""
|
||||||
user = sociallogin.user
|
user = sociallogin.user
|
||||||
if name := data.get("name"):
|
if name := data.get("name"):
|
||||||
user.name = name
|
user.name = name
|
||||||
|
|
Loading…
Reference in New Issue
Block a user