org.views.userprofile

The settings of the logged in user.

Module Contents

Functions

handle_user_profile(→ RenderData | BaseResponse)

Handles the GET and POST login requests.

unsubscribe(→ bool)

Unsubscribe a user from all regular e-mails.

handle_unsubscribe(→ RenderData | BaseResponse)

Unsubscribes a user from all regular e-mails.

handle_unsubscribe_rfc8058(→ morepath.request.Response)

org.views.userprofile.handle_user_profile(self: onegov.org.models.Organisation, request: onegov.org.request.OrgRequest, form: onegov.form.Form, layout: onegov.org.layout.DefaultLayout | None = None) RenderData | BaseResponse[source]

Handles the GET and POST login requests.

org.views.userprofile.unsubscribe(request: onegov.org.request.OrgRequest) bool[source]

Unsubscribe a user from all regular e-mails.

Returns True, if the request was valid.

org.views.userprofile.handle_unsubscribe(self: onegov.org.models.Organisation, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) RenderData | BaseResponse[source]

Unsubscribes a user from all regular e-mails.

To be able to use this method, an url has to be created like this:

'{}?token={}'.format((
    request.link(org, name='unsubscribe'),
    request.new_url_safe_token(
        {'user': 'user@example.org'}, 'unsubscribe'
    )
))

This view never fails and always pretends to be successful.

org.views.userprofile.handle_unsubscribe_rfc8058(self: onegov.org.models.Organisation, request: onegov.org.request.OrgRequest) morepath.request.Response[source]