gaia_cob_pmp.app.adapter

Attributes

Classes

Module Contents

gaia_cob_pmp.app.adapter.User
class gaia_cob_pmp.app.adapter.UsernameAdapter(request=None)

Bases: allauth.socialaccount.adapter.DefaultSocialAccountAdapter

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.

Parameters:
  • request – The signup request.

  • sociallogin – The AllAuth social account link.

  • data – The data from the OAuth provider, uses the fields specified in settings.py.

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.

Parameters:
  • request – The signup request.

  • sociallogin – The AllAuth social account link.

  • form – The form, if any, used in account creation (should be None).

Returns:

The new user.

get_connect_redirect_url(request: django.http.HttpRequest, socialaccount) str

Gets the URL to go to after connecting a social account

Parameters:
  • request – The signup request.

  • socialacccount – The AllAuth social account link.

Returns:

The URL to redirect to.