core: prevent selecting a group as a parent of itself (#6016)
* core: prevent selecting a group as a parent of itself Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix api error when no parent is given Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -95,6 +95,9 @@ export class GroupForm extends ModelForm<Group, string> {
|
||||
args.search = query;
|
||||
}
|
||||
const groups = await new CoreApi(DEFAULT_CONFIG).coreGroupsList(args);
|
||||
if (this.instance) {
|
||||
return groups.results.filter((g) => g.pk !== this.instance?.pk);
|
||||
}
|
||||
return groups.results;
|
||||
}}
|
||||
.renderElement=${(group: Group): string => {
|
||||
|
Reference in New Issue
Block a user