authentik.stages.user_delete.models

delete stage models

 1"""delete stage models"""
 2
 3from django.utils.translation import gettext_lazy as _
 4from django.views import View
 5from rest_framework.serializers import BaseSerializer
 6
 7from authentik.flows.models import Stage
 8
 9
10class UserDeleteStage(Stage):
11    """Delete the pending user without confirmation.
12    Use with caution."""
13
14    @property
15    def serializer(self) -> type[BaseSerializer]:
16        from authentik.stages.user_delete.api import UserDeleteStageSerializer
17
18        return UserDeleteStageSerializer
19
20    @property
21    def view(self) -> type[View]:
22        from authentik.stages.user_delete.stage import UserDeleteStageView
23
24        return UserDeleteStageView
25
26    @property
27    def component(self) -> str:
28        return "ak-stage-user-delete-form"
29
30    class Meta:
31        verbose_name = _("User Delete Stage")
32        verbose_name_plural = _("User Delete Stages")
class UserDeleteStage(authentik.flows.models.Stage):
11class UserDeleteStage(Stage):
12    """Delete the pending user without confirmation.
13    Use with caution."""
14
15    @property
16    def serializer(self) -> type[BaseSerializer]:
17        from authentik.stages.user_delete.api import UserDeleteStageSerializer
18
19        return UserDeleteStageSerializer
20
21    @property
22    def view(self) -> type[View]:
23        from authentik.stages.user_delete.stage import UserDeleteStageView
24
25        return UserDeleteStageView
26
27    @property
28    def component(self) -> str:
29        return "ak-stage-user-delete-form"
30
31    class Meta:
32        verbose_name = _("User Delete Stage")
33        verbose_name_plural = _("User Delete Stages")

Delete the pending user without confirmation. Use with caution.

serializer: type[rest_framework.serializers.BaseSerializer]
15    @property
16    def serializer(self) -> type[BaseSerializer]:
17        from authentik.stages.user_delete.api import UserDeleteStageSerializer
18
19        return UserDeleteStageSerializer

Get serializer for this model

view: type[django.views.generic.base.View]
21    @property
22    def view(self) -> type[View]:
23        from authentik.stages.user_delete.stage import UserDeleteStageView
24
25        return UserDeleteStageView

Return StageView class that implements logic for this stage

component: str
27    @property
28    def component(self) -> str:
29        return "ak-stage-user-delete-form"

Return component used to edit this object

stage_ptr_id
stage_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example::

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

class UserDeleteStage.DoesNotExist(authentik.flows.models.Stage.DoesNotExist):

The requested object does not exist

class UserDeleteStage.MultipleObjectsReturned(authentik.flows.models.Stage.MultipleObjectsReturned):

The query returned multiple objects when only one was expected.