Allow to add organization members as collaborators on organization owned repositories (#4748)
repository... Fixes #4507
This commit is contained in:
parent
a7ee4a6e95
commit
0787056e07
2 changed files with 0 additions and 14 deletions
|
@ -405,19 +405,6 @@ func CollaborationPost(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
// Check if user is organization member.
|
||||
if ctx.Repo.Owner.IsOrganization() {
|
||||
isMember, err := ctx.Repo.Owner.IsOrgMember(u.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("IsOrgMember", err)
|
||||
return
|
||||
} else if isMember {
|
||||
ctx.Flash.Info(ctx.Tr("repo.settings.user_is_org_member"))
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if got, err := ctx.Repo.Repository.IsCollaborator(u.ID); err == nil && got {
|
||||
ctx.Flash.Error(ctx.Tr("repo.settings.add_collaborator_duplicate"))
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue