From 93bdea37691df641715e3bb8ebe5414a916e7b57 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 24 Sep 2021 11:51:03 +0200 Subject: [PATCH] core: fix api return code for user self-update Signed-off-by: Jens Langhammer --- authentik/core/api/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentik/core/api/users.py b/authentik/core/api/users.py index ee1bbcdbb..90b3bf7ce 100644 --- a/authentik/core/api/users.py +++ b/authentik/core/api/users.py @@ -308,7 +308,7 @@ class UserViewSet(UsedByMixin, ModelViewSet): """Allow users to change information on their own profile""" data = UserSelfSerializer(instance=User.objects.get(pk=request.user.pk), data=request.data) if not data.is_valid(): - return Response(data.errors) + return Response(data.errors, status=400) new_user = data.save() # If we're impersonating, we need to update that user object # since it caches the full object