fairdm.contrib.contributors.views.claiming#

Views for the token-based profile claiming flow.

Module Contents#

Classes#

ClaimProfileView

Show the unclaimed profile a claim token names, for the user to confirm.

ClaimProfileConfirmView

Claim the profile a token names, for the signed-in user.

Data#

API#

logger#

‘getLogger(…)’

class ClaimProfileView(**kwargs)#

Bases: django.views.generic.TemplateView

Show the unclaimed profile a claim token names, for the user to confirm.

Nothing is claimed on GET. An anonymous visitor is sent to sign in with the token kept in the session, and an invalid token or a deactivated profile renders an error.

Attributes: template_name: The confirmation template.

Initialization

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name#

‘contributors/claim_profile.html’

get(request, *args, **kwargs)#

Render the confirmation page, or an error, or send an anonymous visitor to sign in.

class ClaimProfileConfirmView(**kwargs)#

Bases: django.contrib.auth.mixins.LoginRequiredMixin, django.views.generic.TemplateView

Claim the profile a token names, for the signed-in user.

Attributes: template_name: The template rendered when the claim fails.

Initialization

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name#

‘contributors/claim_profile.html’

post(request, *args, **kwargs)#

Claim the profile and redirect to the user’s page, or re-render with the error.