websauna.system.user.registrationservice module

Sign up form service.

class websauna.system.user.registrationservice.DefaultRegistrationService(request)[source]

Bases: object

Default sign up mechanism.

Send activation email to everybody and ask them to click a link there.

activate_by_email(activation_code, location=None)[source]

Active a user after user after the activation email.

  • User clicks link in the activation email

  • User enters the activation code on the form by hand

Parameters
  • activation_code (str) – Activation code for user account.

  • location (Optional[str]) – URL to redirct the user to, after activation.

Raise

HTTPNotFound is activation_code is invalid.

Return type

Response

Returns

Redirect to location.

create_email_activation(user)[source]

Create through-the-web user sign up with his/her email.

We don’t want to force the users to pick up an usernames, so we just generate an username. The user is free to change their username later.

Parameters

user (InterfaceClass) – User object.

sign_up(user_data)[source]

Sign up a new user.

Parameters

user_data (dict) – User data.

Return type

Response

Returns

Either a redirect to a post-signup location or a page informing the user has to activate their account.