web/admin: fix user defaulting to 0 when not set in PolicyBindingForm
closes #2496 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
f4955e3e62
commit
1f6af8c221
|
@ -222,8 +222,8 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
|
|||
.renderElement=${(group: Group): string => {
|
||||
return group.name;
|
||||
}}
|
||||
.value=${(group: Group | undefined): string => {
|
||||
return group ? group.pk : "";
|
||||
.value=${(group: Group | undefined): string | undefined => {
|
||||
return group ? group.pk : undefined;
|
||||
}}
|
||||
.selected=${(group: Group): boolean => {
|
||||
return group.pk === this.instance?.group;
|
||||
|
@ -256,8 +256,8 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
|
|||
.renderElement=${(user: User): string => {
|
||||
return UserOption(user);
|
||||
}}
|
||||
.value=${(user: User | undefined): number => {
|
||||
return user ? user.pk : 0;
|
||||
.value=${(user: User | undefined): number | undefined => {
|
||||
return user ? user.pk : undefined;
|
||||
}}
|
||||
.selected=${(user: User): boolean => {
|
||||
return user.pk === this.instance?.user;
|
||||
|
|
Reference in a new issue