diff --git a/authentik/core/api/utils.py b/authentik/core/api/utils.py index 2703d3c70..6c28debd6 100644 --- a/authentik/core/api/utils.py +++ b/authentik/core/api/utils.py @@ -41,6 +41,7 @@ class MetaNameSerializer(PassiveSerializer): verbose_name = SerializerMethodField() verbose_name_plural = SerializerMethodField() + meta_model_name = SerializerMethodField() def get_verbose_name(self, obj: Model) -> str: """Return object's verbose_name""" @@ -50,6 +51,10 @@ class MetaNameSerializer(PassiveSerializer): """Return object's plural verbose_name""" return obj._meta.verbose_name_plural + def get_meta_model_name(self, obj: Model) -> str: + """Return internal model name""" + return f"{obj._meta.app_label}.{obj._meta.model_name}" + class TypeCreateSerializer(PassiveSerializer): """Types of an object that can be created""" diff --git a/schema.yml b/schema.yml index a4d1439b0..497e4a655 100644 --- a/schema.yml +++ b/schema.yml @@ -20425,6 +20425,9 @@ components: verbose_name_plural: type: string readOnly: true + meta_model_name: + type: string + readOnly: true pk: type: integer name: @@ -20433,6 +20436,7 @@ components: type: string readOnly: true required: + - meta_model_name - name - pk - type