diff --git a/authentik/blueprints/tests/test_serializer_models.py b/authentik/blueprints/tests/test_serializer_models.py index 718caa502..78dc55348 100644 --- a/authentik/blueprints/tests/test_serializer_models.py +++ b/authentik/blueprints/tests/test_serializer_models.py @@ -6,6 +6,7 @@ from django.test import TestCase from authentik.blueprints.v1.importer import is_model_allowed from authentik.lib.models import SerializerModel +from authentik.providers.oauth2.models import RefreshToken class TestModels(TestCase): @@ -21,6 +22,9 @@ def serializer_tester_factory(test_model: Type[SerializerModel]) -> Callable: model_class = test_model() self.assertTrue(isinstance(model_class, SerializerModel)) self.assertIsNotNone(model_class.serializer) + if model_class.serializer.Meta().model == RefreshToken: + return + self.assertEqual(model_class.serializer.Meta().model, test_model) return tester diff --git a/authentik/stages/invitation/models.py b/authentik/stages/invitation/models.py index d5386c34e..ef6cb1cb2 100644 --- a/authentik/stages/invitation/models.py +++ b/authentik/stages/invitation/models.py @@ -73,12 +73,12 @@ class Invitation(SerializerModel, ExpiringModel): @property def serializer(self) -> Serializer: - from authentik.stages.consent.api import UserConsentSerializer + from authentik.stages.invitation.api import InvitationSerializer - return UserConsentSerializer + return InvitationSerializer def __str__(self): - return f"Invitation {self.invite_uuid.hex} created by {self.created_by}" + return f"Invitation {str(self.invite_uuid)} created by {self.created_by}" class Meta: verbose_name = _("Invitation")