Authentication

This package contains views related to registration, login, logout and password reset

Password Reset Confirm View

class ycms.cms.views.authentication.password_reset_confirm_view.PasswordResetConfirmView(**kwargs)

Bases: PasswordResetConfirmView

View to set a new password.

dispatch(*args, **kwargs)

The view part of the view. Handles all HTTP methods equally.

Parameters:
  • *args (list) – The supplied arguments

  • **kwargs (dict) – The supplied keyword arguments

Returns:

The rendered template response or a redirection to the login page

Return type:

TemplateResponse or HttpResponseRedirect

form_valid(form)

If the form is valid, show a success message.

Parameters:

form (SetPasswordForm) – The supplied form

Returns:

form validation

Return type:

HttpResponse

success_url = '/accounts/login/'
template_name = 'authentication/password_reset_confirm.html'
token_generator = <ycms.cms.utils.token_generator.CustomPasswordResetTokenGenerator object>

Password Reset Request View

class ycms.cms.views.authentication.password_reset_request_view.PasswordResetRequestView(**kwargs)

Bases: FormView

View allowing users to request a password reset

form_class

alias of PasswordResetRequestForm

form_valid(form)

Overwrite the form_valid method to additionally send a reset email

Parameters:

form (RegistrationForm) – The user-submitted form

success_url = '/accounts/login/'
template_name = 'authentication/password_reset_request.html'

Registration View

class ycms.cms.views.authentication.registration_view.RegistrationView(**kwargs)

Bases: CreateView

View allowing new users to sign up as offer providers

dispatch(request, *args, **kwargs)
form_class

alias of RegistrationForm

form_valid(form)

Overwrite the form_valid method to additionally send a confirmation email

Parameters:

form (RegistrationForm) – The user-submitted form

get_form_kwargs()

Return the keyword arguments for instantiating the form

Returns:

The form kwargs

Return type:

dict

success_url = '/accounts/create-user/'
template_name = 'authentication/create_user.html'