User linking views

Mainly for the manual user linking implementation, this moduel defines the views and the viewset mixin to link one helmholtz user to an existing django user. It’s copying the passwort reset implementation of django.contrib.auth

Classes:

LinkingUserViewsetMixin()

A mixin to provide form to link a user.

UserLinkingContextMixin()

class django_helmholtz_aai.views.auth.linking.LinkingUserViewsetMixin

Bases: object

A mixin to provide form to link a user.

Classes:

UserLinkingConfirmView(**kwargs)

UserLinkingDoneView(**kwargs)

UserLinkingView(**kwargs)

Methods:

get_urls()

class UserLinkingConfirmView(**kwargs)

Bases: UserLinkingContextMixin, SuccessMessageMixin, UpdateUserMixin, FormView

Methods:

dispatch(*args, **kwargs)

form_valid(form)

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)

Insert the form into the context dict.

get_success_url()

Return the URL to redirect to after processing a valid form.

update_user()

Update the VOs and attributes from the new user.

Classes:

form_class

alias of Form

Attributes:

post_mapping_login

post_mapping_login_backend

reset_url_token

success_message

template_name

title

token_generator

userinfo

aai_user: HelmholtzUser
dispatch(*args, **kwargs)
form_class

alias of Form Attributes:

media

Return all media required to render the widgets on this form.

form_valid(form)

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)

Insert the form into the context dict.

get_success_url() str

Return the URL to redirect to after processing a valid form.

post_mapping_login = True
post_mapping_login_backend = None
request: Any
reset_url_token = 'link-user'
success_message = 'User accounts have been linked.'
template_name = 'helmholtz_aai/link_user_confirm.html'
title = 'Confirm Helmholtz User Mapping'
token_generator = <django_helmholtz_aai.tokens.UserLinkingTokenGenerator object>
update_user()

Update the VOs and attributes from the new user.

userinfo: Dict[str, Any]
class UserLinkingDoneView(**kwargs)

Bases: UserLinkingContextMixin, TemplateView

Attributes:

template_name

title

template_name = 'helmholtz_aai/link_user_done.html'
title = 'Mapping instructions sent'
class UserLinkingView(**kwargs)

Bases: UserLinkingContextMixin, FormView

Attributes:

aai_user

email_template_name

extra_email_context

from_email

html_email_template_name

subject_template_name

template_name

title

token_generator

Methods:

dispatch(*args, **kwargs)

form_valid(form)

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)

Insert the form into the context dict.

get_form_kwargs()

Return the keyword arguments for instantiating the form.

get_success_url()

Return the URL to redirect to after processing a valid form.

Classes:

form_class

alias of UserLinkingForm

aai_user
dispatch(*args, **kwargs)
email_template_name = 'helmholtz_aai/link_user_email.html'
extra_email_context = None
form_class

alias of UserLinkingForm Methods:

__init__(*args, **kwargs)

get_users(email, **kwargs)

Given an email, return matching user(s).

save([domain_override, ...])

Generate a one-use only link for resetting password and send it to the user.

send_mail(subject_template_name, ...[, ...])

Send a django.core.mail.EmailMultiAlternatives to to_email.

Attributes:

media

Return all media required to render the widgets on this form.

form_valid(form)

If the form is valid, redirect to the supplied URL.

from_email = None
get_context_data(**kwargs)

Insert the form into the context dict.

get_form_kwargs() Dict[str, Any]

Return the keyword arguments for instantiating the form.

get_success_url() str

Return the URL to redirect to after processing a valid form.

html_email_template_name = None
subject_template_name = 'helmholtz_aai/link_user_subject.txt'
template_name = 'helmholtz_aai/link_user_form.html'
title = 'Map Helmholtz AAI User'
token_generator = <django_helmholtz_aai.tokens.UserLinkingTokenGenerator object>
get_urls()
class django_helmholtz_aai.views.auth.linking.UserLinkingContextMixin

Bases: object

Attributes:

extra_context

Methods:

get_context_data(**kwargs)

get_user(uidb64[, UserModel])

extra_context = None
get_context_data(**kwargs)
get_user(uidb64, UserModel=<class 'django.contrib.auth.models.User'>, **kwargs) User | None