feat: fix issue that a user can belong to two physical groups at the same time (#4084)

This commit is contained in:
Robin Ye
2025-08-15 23:42:09 +08:00
committed by GitHub
parent b5c80513fb
commit 2493ae9cfe

View File

@@ -326,7 +326,7 @@ class UserEditPage extends React.Component {
</Col>
<Col span={22} >
<Select virtual={false} mode="multiple" style={{width: "100%"}} disabled={disabled} value={this.state.user.groups ?? []} onChange={(value => {
if (this.state.groups?.filter(group => value.includes(group.name))
if (this.state.groups?.filter(group => value.includes(`${group.owner}/${group.name}`))
.filter(group => group.type === "Physical").length > 1) {
Setting.showMessage("error", i18next.t("general:You can only select one physical group"));
return;