swh.web.alter.views module#

swh.web.alter.views.content_policies(request: HttpRequest) HttpResponse[source]#

Display the archive content policies.

If the user has already verified an email address the link to the alteration request assistant at the end of the page will lead to the assistant_category view and if not, to the assistant_email_form one.

Parameters:

request – an HttpRequest

Returns:

Content policies

swh.web.alter.views.assistant_email(request: HttpRequest) HttpResponse[source]#

Email verification.

Step 0/4, before accessing the request assistant we need to make sure we’re able to contact the Requester. This form will: 1. verify the email has not been previously blocked 2. send an email message containing a link to confirm the address is working

Parameters:

request – an HttpRequest

Returns:

Email verification form or a redirect to assistant_category

swh.web.alter.views.assistant_email_verification(request: HttpRequest, value: str) HttpResponse[source]#

Authorize access to the assistant through an access token.

The assistant_email_form form sends a magic link to this view. If a token matching value exists and is still valid, a session value is set and the user is redirected to the assistant_category view.

Parameters:
  • request – an HttpRequest

  • value – an access Token value

Returns:

A redirection to the assistant if the token is still valid or to the assistant_email_form view if it has expired.

swh.web.alter.views.assistant_category(request: HttpRequest) HttpResponse[source]#

Set the alteration category.

Step 1/4.

Parameters:

request – an HttpRequest

Returns:

A list of common alteration reasons to chose from.

swh.web.alter.views.assistant_origins(request: HttpRequest) HttpResponse[source]#

Origins selection.

Step 2/4. A view used to build the list of Origins related to the user’s alteration. Chosen Origins are then stored in the user’s session.

A category parameter set by the link clicked in the alteration_category view is needed to access this view, it is then stored in the session.

This is a really basic “origin shopping cart” implementation, that only handles origins coming from a single search query.

Parameters:

request – an HttpRequest

Returns:

The origins selection form or a redirect to alteration_category if no type is provided.

swh.web.alter.views.assistant_reasons(request: HttpRequest) HttpResponse[source]#

Alteration reasons and expected outcome.

Step 3/4.

Parameters:

request – an HttpRequest

Returns:

The reasons/outcome form.

swh.web.alter.views.assistant_summary(request: HttpRequest) HttpResponse[source]#

Alteration request summary.

Step 4/4.

Parameters:

request – an HttpRequest

Returns:

A summary of previous steps and a confirmation form.

swh.web.alter.views.alteration_details(request: HttpRequest, pk: UUID) HttpResponse[source]#

Alteration request details.

This is the primary interface for the Requester to track and manage its alteration request.

This view is protected by a session variable which is set when the user passes the alteration_access check.

Parameters:
  • request – an HttpRequest

  • pk – an Alteration identifier

Returns:

Alteration detail

swh.web.alter.views.alteration_message(request: HttpRequest, pk: UUID) HttpResponse[source]#

Send a message for a Alteration.

Parameters:
  • request – an HttpRequest

  • pk – an Alteration identifier

Returns:

A redirection to the alteration detail view

swh.web.alter.views.alteration_access(request: HttpRequest, pk: UUID) HttpResponse[source]#

Alteration security check.

Security check before accessing a Alteration.

Parameters:
  • request – an HttpRequest

  • pk – an Alteration identifier

Returns:

A alteration security form

Authorize access to an alteration request through an access token.

The alteration_access form sends a magic link to this view. If a token matching value exists and is still valid, a session value is set and the user is redirected to its alteration request.

Parameters:
  • request – an HttpRequest

  • value – an access Token value

Returns:

A redirection to an alteration request if the token is still valid or to the alteration_access view if it has expired.

swh.web.alter.views.admin_dashboard(request: HttpRequest) HttpResponse[source]#

Alteration admin dashboard.

List and search alteration requests.

Parameters:

request – an HttpRequest

Returns:

A list of alterations

swh.web.alter.views.admin_alteration(request: HttpRequest, pk: UUID) HttpResponse[source]#

Manage an alteration.

Parameters:
  • request – an HttpRequest

  • pk – an Alteration identifier

Returns:

A alteration administration form.

swh.web.alter.views.admin_origin(request: HttpRequest, alteration_pk: UUID, pk: UUID | None = None) HttpResponse[source]#

Origin admin.

Only admins are allowed to create or modify an origin.

Parameters:
  • request – an HttpRequest

  • alteration_pk – a Alteration identifier

  • pk – an Origin identifier, if set this is an update request

Returns:

A redirection to the alteration admin view

swh.web.alter.views.admin_message(request: HttpRequest, pk: UUID) HttpResponse[source]#

Send a message for an Alteration.

Parameters:
  • request – an HttpRequest

  • pk – an Alteration identifier

Returns:

A redirection to the alteration admin view

swh.web.alter.views.admin_event(request: HttpRequest, alteration_pk: UUID, pk: UUID) HttpResponse[source]#

Edit an event for an Alteration.

Parameters:
  • request – an HttpRequest

  • pk – an Event identifier

Returns:

A redirection to the alteration admin view