diff options
author | Unknwon <u@gogs.io> | 2017-02-24 13:56:02 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-24 13:56:02 -0500 |
commit | 10b93efc4a3061d01b75b44b91a617698971e38b (patch) | |
tree | de3d093876a0de391de72f081a7b15afa6fd27cc /routers | |
parent | 0696d430c9baa409297dc06ffa0ab84c0ea44a29 (diff) |
repo: able to add organization member as repository collaborator
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/setting.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 7cafe3e3..0dca950a 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -320,20 +320,13 @@ func SettingsCollaborationPost(ctx *context.Context) { return } - // Organization is not allowed to be added as a collaborator. + // Organization is not allowed to be added as a collaborator if u.IsOrganization() { ctx.Flash.Error(ctx.Tr("repo.settings.org_not_allowed_to_be_collaborator")) ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path) return } - // Check if user is organization member. - if ctx.Repo.Owner.IsOrganization() && ctx.Repo.Owner.IsOrgMember(u.ID) { - ctx.Flash.Info(ctx.Tr("repo.settings.user_is_org_member")) - ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration") - return - } - if err = ctx.Repo.Repository.AddCollaborator(u); err != nil { ctx.Handle(500, "AddCollaborator", err) return |