mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
fix bug to deny to add orgnization as a member of an orgnization or team (#1815)
This commit is contained in:
@@ -114,6 +114,12 @@ func Invitation(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if u.IsOrganization() {
|
||||
ctx.Flash.Error(ctx.Tr("form.cannot_invite_org_to_org"))
|
||||
ctx.Redirect(ctx.Org.OrgLink + "/invitations/new")
|
||||
return
|
||||
}
|
||||
|
||||
if err = org.AddMember(u.ID); err != nil {
|
||||
ctx.Handle(500, " AddMember", err)
|
||||
return
|
||||
|
@@ -88,6 +88,12 @@ func TeamsAction(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if u.IsOrganization() {
|
||||
ctx.Flash.Error(ctx.Tr("form.cannot_add_org_to_team"))
|
||||
ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName)
|
||||
return
|
||||
}
|
||||
|
||||
err = ctx.Org.Team.AddMember(u.ID)
|
||||
page = "team"
|
||||
}
|
||||
|
Reference in New Issue
Block a user