Settings

This package contains all views related to settings

Dismiss Tutorial View

class integreat_cms.cms.views.settings.dismiss_tutorial_view.DismissTutorial(**kwargs)[source]

Bases: View

View to mark a tutorial dismissed for the current user. If it was marked dismissed it should not be shown again automatically.

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

dispatch(request, *args, **kwargs)[source]
http_method_names = ['post'][source]

The list of HTTP method names that this view will accept. Since this changes the database, we want to have the csrf protection of post views.

http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, *args: Any, **kwargs: Any) JsonResponse[source]

Marks a tutorial as dismissed

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

The rendered template response

Return type:

JsonResponse

setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

view_is_async = False[source]

Totp Delete View

class integreat_cms.cms.views.settings.totp_delete_view.TOTPDeleteView(**kwargs)[source]

Bases: TemplateView

View to delete the TOTP key and disconnect authenticators.

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = None[source]
get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Render confirmation view for TOTP deletion

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

The rendered template response

Return type:

HttpResponse

get_context_data(**kwargs)[source]
get_template_names()[source]

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Delete the TOTP key of an user.

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

A redirection to the account settings

Return type:

HttpResponse

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'settings/delete_totp.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]

Totp Register View

class integreat_cms.cms.views.settings.totp_register_view.TOTPRegisterView(**kwargs)[source]

Bases: TemplateView

View to register a TOTP authenticator.

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = None[source]
get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Initialize the registration for the authentication application.

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

A redirection to the account settings

Return type:

HttpResponse

get_context_data(**kwargs)[source]
get_template_names()[source]

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

View to validate the connection between the authenticator app and the user account.

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

A redirection to the account settings

Return type:

HttpResponse

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'settings/register_totp.html'[source]
view_is_async = False[source]

User Settings View

class integreat_cms.cms.views.settings.user_settings_view.UserSettingsView(**kwargs)[source]

Bases: TemplateView

View for the individual account settings

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = None[source]
get(request, *args, **kwargs)[source]
get_context_data(**kwargs: Any) dict[str, Any][source]

Returns a dictionary representing the template context (see get_context_data()).

Parameters:

**kwargs (Any) – The given keyword arguments

Returns:

The template context

Return type:

dict[str, Any]

get_template_names()[source]

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponseRedirect[source]

Submit UserEmailForm and UserPasswordForm and save User object

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

The rendered template response

Return type:

HttpResponseRedirect

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

setup(request, *args, **kwargs)[source]

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'settings/user_settings.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]