gaia_cob_pmp.app.adapter ======================== .. py:module:: gaia_cob_pmp.app.adapter Attributes ---------- .. autoapisummary:: gaia_cob_pmp.app.adapter.User Classes ------- .. autoapisummary:: gaia_cob_pmp.app.adapter.UsernameAdapter Module Contents --------------- .. py:data:: User .. py:class:: UsernameAdapter(request=None) Bases: :py:obj:`allauth.socialaccount.adapter.DefaultSocialAccountAdapter` .. py:method:: populate_user(request: django.http.HttpRequest, sociallogin, data) By default, Django uses an account's username in dropdowns e.t.c. SocialAccounts use email instead, so we populate the 'username' with the user's name. :param request: The signup request. :param sociallogin: The AllAuth social account link. :param data: The data from the OAuth provider, uses the fields specified in settings.py. .. py:method:: save_user(request: django.http.HttpRequest, sociallogin, form=None) -> User Hooks into the user save to create a matching researcher, as well as setting the user to inactive. :param request: The signup request. :param sociallogin: The AllAuth social account link. :param form: The form, if any, used in account creation (should be None). :returns: The new user. .. py:method:: get_connect_redirect_url(request: django.http.HttpRequest, socialaccount) -> str Gets the URL to go to after connecting a social account :param request: The signup request. :param socialacccount: The AllAuth social account link. :returns: The URL to redirect to.