Jump to >

reviewboard.accounts.mixins

Mixins for account-related views.

class CheckLoginRequiredViewMixin[source]

View mixin to check if a user needs to be logged in.

This is a convenience around using the @check_login_required decorator for class-based views.

dispatch(*args, **kwargs)[source]

Dispatch a HTTP request to the right handler.

Parameters
  • *args (tuple) – Positional arguments to pass to the handler.

  • **kwargs (tuple) –

    Keyword arguments to pass to the handler.

    These will be arguments provided by the URL pattern.

Returns

The resulting HTTP response to send to the client.

Return type

django.http.HttpResponse

class LoginRequiredViewMixin[source]

View mixin to ensure a user is logged in.

This is a convenience around using the @login_required decorator for class-based views.

dispatch(*args, **kwargs)[source]

Dispatch a HTTP request to the right handler.

Parameters
  • *args (tuple) – Positional arguments to pass to the handler.

  • **kwargs (tuple) –

    Keyword arguments to pass to the handler.

    These will be arguments provided by the URL pattern.

Returns

The resulting HTTP response to send to the client.

Return type

django.http.HttpResponse

class UserProfileRequiredViewMixin[source]

View mixin to ensure a user has a profile set up.

This is a convenience around using the @valid_prefs_required decorator for class-based views.

dispatch(*args, **kwargs)[source]

Dispatch a HTTP request to the right handler.

Parameters
  • *args (tuple) – Positional arguments to pass to the handler.

  • **kwargs (tuple) –

    Keyword arguments to pass to the handler.

    These will be arguments provided by the URL pattern.

Returns

The resulting HTTP response to send to the client.

Return type

django.http.HttpResponse

class PolicyConsentFormMixin(*args, **kwargs)[source]

Form mixin to add consent to privacy policy and terms of service.

accept_policies(user)[source]

Accept the linked policies for the given user.

Parameters

user (django.contrib.auth.models.User) – The user who has accepted the privacy policy and/or terms of service.