diff --git a/authentik/flows/models.py b/authentik/flows/models.py index 45f0f61bae..b7f1cd7589 100644 --- a/authentik/flows/models.py +++ b/authentik/flows/models.py @@ -72,7 +72,7 @@ class Stage(SerializerModel): def __str__(self): if hasattr(self, "__in_memory_type"): return f"In-memory Stage {getattr(self, '__in_memory_type')}" - return f"Stage {self.name}" + return self.name def in_memory_stage(view: Type["StageView"]) -> Stage: diff --git a/authentik/policies/models.py b/authentik/policies/models.py index a495cc73d7..9ad95422af 100644 --- a/authentik/policies/models.py +++ b/authentik/policies/models.py @@ -138,7 +138,7 @@ class Policy(SerializerModel, CreatedUpdatedModel): raise NotImplementedError def __str__(self): - return f"{self.__class__.__name__} {self.name}" + return self.name def passes(self, request: PolicyRequest) -> PolicyResult: # pragma: no cover """Check if request passes this policy""" diff --git a/authentik/stages/authenticator_validate/models.py b/authentik/stages/authenticator_validate/models.py index 73d0607517..4938be2db2 100644 --- a/authentik/stages/authenticator_validate/models.py +++ b/authentik/stages/authenticator_validate/models.py @@ -66,9 +66,6 @@ class AuthenticatorValidateStage(Stage): return AuthenticatorValidateStageForm - def __str__(self) -> str: - return f"Authenticator Validation Stage {self.name}" - class Meta: verbose_name = _("Authenticator Validation Stage") diff --git a/authentik/stages/captcha/models.py b/authentik/stages/captcha/models.py index c6eeac1f36..d2a0fe5012 100644 --- a/authentik/stages/captcha/models.py +++ b/authentik/stages/captcha/models.py @@ -42,9 +42,6 @@ class CaptchaStage(Stage): return CaptchaStageForm - def __str__(self): - return f"Captcha Stage {self.name}" - class Meta: verbose_name = _("Captcha Stage") diff --git a/authentik/stages/consent/models.py b/authentik/stages/consent/models.py index 5598da54c9..4a96944e23 100644 --- a/authentik/stages/consent/models.py +++ b/authentik/stages/consent/models.py @@ -56,9 +56,6 @@ class ConsentStage(Stage): return ConsentStageForm - def __str__(self): - return f"Consent Stage {self.name}" - class Meta: verbose_name = _("Consent Stage") diff --git a/authentik/stages/dummy/models.py b/authentik/stages/dummy/models.py index 3dfb768bd4..344868a82a 100644 --- a/authentik/stages/dummy/models.py +++ b/authentik/stages/dummy/models.py @@ -32,9 +32,6 @@ class DummyStage(Stage): return DummyStageForm - def __str__(self): - return f"Dummy Stage {self.name}" - class Meta: verbose_name = _("Dummy Stage") diff --git a/authentik/stages/identification/models.py b/authentik/stages/identification/models.py index 88b20a9668..a7b2f42186 100644 --- a/authentik/stages/identification/models.py +++ b/authentik/stages/identification/models.py @@ -89,9 +89,6 @@ class IdentificationStage(Stage): return IdentificationStageForm - def __str__(self): - return f"Identification Stage {self.name}" - class Meta: verbose_name = _("Identification Stage") diff --git a/authentik/stages/invitation/models.py b/authentik/stages/invitation/models.py index be3982744f..7d97a0ebbb 100644 --- a/authentik/stages/invitation/models.py +++ b/authentik/stages/invitation/models.py @@ -45,9 +45,6 @@ class InvitationStage(Stage): return InvitationStageForm - def __str__(self): - return f"Invitation Stage {self.name}" - class Meta: verbose_name = _("Invitation Stage") diff --git a/authentik/stages/password/models.py b/authentik/stages/password/models.py index e599d49cdd..7992fd45d1 100644 --- a/authentik/stages/password/models.py +++ b/authentik/stages/password/models.py @@ -55,9 +55,6 @@ class PasswordStage(ConfigurableStage, Stage): "authentik_stages_password:user-settings", kwargs={"stage_uuid": self.pk} ) - def __str__(self): - return f"Password Stage {self.name}" - class Meta: verbose_name = _("Password Stage") diff --git a/authentik/stages/prompt/models.py b/authentik/stages/prompt/models.py index 46d55b870c..e7450725b7 100644 --- a/authentik/stages/prompt/models.py +++ b/authentik/stages/prompt/models.py @@ -115,7 +115,7 @@ class Prompt(SerializerModel): return super().save(*args, **kwargs) def __str__(self): - return f"Prompt '{self.field_key}' type={self.type}" + return f"Prompt field '{self.field_key}' type {self.type}" class Meta: @@ -148,9 +148,6 @@ class PromptStage(Stage): return PromptStageForm - def __str__(self): - return f"Prompt Stage {self.name}" - class Meta: verbose_name = _("Prompt Stage") diff --git a/authentik/stages/user_delete/models.py b/authentik/stages/user_delete/models.py index f9ef53e005..7e791e8c03 100644 --- a/authentik/stages/user_delete/models.py +++ b/authentik/stages/user_delete/models.py @@ -31,9 +31,6 @@ class UserDeleteStage(Stage): return UserDeleteStageForm - def __str__(self): - return f"User Delete Stage {self.name}" - class Meta: verbose_name = _("User Delete Stage") diff --git a/authentik/stages/user_login/models.py b/authentik/stages/user_login/models.py index d25018f79f..db885dbd36 100644 --- a/authentik/stages/user_login/models.py +++ b/authentik/stages/user_login/models.py @@ -42,9 +42,6 @@ class UserLoginStage(Stage): return UserLoginStageForm - def __str__(self): - return f"User Login Stage {self.name}" - class Meta: verbose_name = _("User Login Stage") diff --git a/authentik/stages/user_logout/models.py b/authentik/stages/user_logout/models.py index c59ff085c2..8f07a5236a 100644 --- a/authentik/stages/user_logout/models.py +++ b/authentik/stages/user_logout/models.py @@ -30,9 +30,6 @@ class UserLogoutStage(Stage): return UserLogoutStageForm - def __str__(self): - return f"User Logout Stage {self.name}" - class Meta: verbose_name = _("User Logout Stage") diff --git a/authentik/stages/user_write/models.py b/authentik/stages/user_write/models.py index 820b5bd929..f4d8b63c46 100644 --- a/authentik/stages/user_write/models.py +++ b/authentik/stages/user_write/models.py @@ -31,9 +31,6 @@ class UserWriteStage(Stage): return UserWriteStageForm - def __str__(self): - return f"User Write Stage {self.name}" - class Meta: verbose_name = _("User Write Stage")