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:
A mixin to provide form to link a user. |
|
- class django_helmholtz_aai.views.auth.linking.LinkingUserViewsetMixin
Bases:
objectA 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,FormViewMethods:
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.
Return the URL to redirect to after processing a valid form.
Update the VOs and attributes from the new user.
Classes:
alias of
FormAttributes:
- aai_user: HelmholtzUser
- dispatch(*args, **kwargs)
- form_class
alias of
FormAttributes:mediaReturn 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.
- post_mapping_login = True
- post_mapping_login_backend = None
- 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.
- class UserLinkingDoneView(**kwargs)
Bases:
UserLinkingContextMixin,TemplateViewAttributes:
- template_name = 'helmholtz_aai/link_user_done.html'
- title = 'Mapping instructions sent'
- class UserLinkingView(**kwargs)
Bases:
UserLinkingContextMixin,FormViewAttributes:
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.
Return the keyword arguments for instantiating the form.
Return the URL to redirect to after processing a valid form.
Classes:
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
UserLinkingFormMethods:__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:
mediaReturn 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.
- 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()