core: make user's name field fully options

closes #1537

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-10-05 11:23:27 +02:00
parent e742494f3d
commit 16f2603130
3 changed files with 6 additions and 4 deletions

View file

@ -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},
}

View file

@ -58,12 +58,11 @@ export class UserForm extends ModelForm<User, number> {
${t`Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.`}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${t`Name`} ?required=${true} name="name">
<ak-form-element-horizontal label=${t`Name`} name="name">
<input
type="text"
value="${ifDefined(this.instance?.name)}"
class="pf-c-form-control"
required
/>
<p class="pf-c-form__helper-text">${t`User's display name.`}</p>
</ak-form-element-horizontal>

View file

@ -55,12 +55,11 @@ export class UserSelfForm extends ModelForm<UserSelf, number> {
${t`Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.`}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${t`Name`} ?required=${true} name="name">
<ak-form-element-horizontal label=${t`Name`} name="name">
<input
type="text"
value="${ifDefined(this.instance?.name)}"
class="pf-c-form-control"
required
/>
<p class="pf-c-form__helper-text">${t`User's display name.`}</p>
</ak-form-element-horizontal>