From 73d57d6f8272b2077d212f06a528b44bcb4183b4 Mon Sep 17 00:00:00 2001
From: Jens Langhammer
Date: Tue, 5 Oct 2021 11:23:27 +0200
Subject: [PATCH] core: make user's name field fully options
closes #1537
Signed-off-by: Jens Langhammer
---
authentik/core/api/users.py | 4 ++++
web/src/pages/users/UserForm.ts | 3 +--
web/src/user/user-settings/UserSelfForm.ts | 3 +--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/authentik/core/api/users.py b/authentik/core/api/users.py
index 90b3bf7ce..623e919dd 100644
--- a/authentik/core/api/users.py
+++ b/authentik/core/api/users.py
@@ -90,6 +90,9 @@ class UserSerializer(ModelSerializer):
"attributes",
"uid",
]
+ extra_kwargs = {
+ "name": {"allow_blank": True},
+ }
class UserSelfSerializer(ModelSerializer):
@@ -117,6 +120,7 @@ class UserSelfSerializer(ModelSerializer):
]
extra_kwargs = {
"is_active": {"read_only": True},
+ "name": {"allow_blank": True},
}
diff --git a/web/src/pages/users/UserForm.ts b/web/src/pages/users/UserForm.ts
index 5e2f98688..349c0656a 100644
--- a/web/src/pages/users/UserForm.ts
+++ b/web/src/pages/users/UserForm.ts
@@ -58,12 +58,11 @@ export class UserForm extends ModelForm {
${t`Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.`}
-
+
${t`User's display name.`}
diff --git a/web/src/user/user-settings/UserSelfForm.ts b/web/src/user/user-settings/UserSelfForm.ts
index 7660b4ecf..33fa9d97a 100644
--- a/web/src/user/user-settings/UserSelfForm.ts
+++ b/web/src/user/user-settings/UserSelfForm.ts
@@ -55,12 +55,11 @@ export class UserSelfForm extends ModelForm {
${t`Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.`}
-
+
${t`User's display name.`}