Jump to >

reviewboard.accounts.mixins

Mixins for account-related views.

class CheckLoginRequiredViewMixin[source]

Bases: object

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]

Bases: object

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]

Bases: object

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]

Bases: object

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

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

Initialize the mixin.

Parameters
  • *args (tuple) – Additional positional arguments to pass to the superclass constructor.

  • **kwargs (dict) – Additional keyword arguments to pass to the superclass constructor.

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.

__annotations__ = {}