From 4e20cd0fee4df14796ffeb39daa3205ae4262f40 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 25 Dec 2020 23:45:28 +0100 Subject: [PATCH] core: fix error during migrations --- authentik/core/api/users.py | 3 +++ authentik/stages/invitation/forms.py | 1 - swagger.yaml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/authentik/core/api/users.py b/authentik/core/api/users.py index b4fb8554b..c2446d8c3 100644 --- a/authentik/core/api/users.py +++ b/authentik/core/api/users.py @@ -36,6 +36,9 @@ class UserViewSet(ModelViewSet): queryset = User.objects.all() serializer_class = UserSerializer + def get_queryset(self): + return User.objects.all().exclude(pk=get_anonymous_user().pk) + @swagger_auto_schema(responses={200: UserSerializer(many=False)}) @action(detail=False) # pylint: disable=invalid-name diff --git a/authentik/stages/invitation/forms.py b/authentik/stages/invitation/forms.py index 5a1c74d12..30fd2622f 100644 --- a/authentik/stages/invitation/forms.py +++ b/authentik/stages/invitation/forms.py @@ -1,6 +1,5 @@ """authentik flows invitation forms""" from django import forms -from django.utils.translation import gettext as _ from authentik.admin.fields import CodeMirrorWidget, YAMLField from authentik.stages.invitation.models import Invitation, InvitationStage diff --git a/swagger.yaml b/swagger.yaml index dfea7655b..214bbf27f 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -8595,6 +8595,7 @@ definitions: x-nullable: true fixed_data: title: Fixed data + description: Optional fixed data to enforce on user enrollment. type: object OTPStaticStage: description: OTPStaticStage Serializer