diff options
author | Sasha Varlamov <sasha@sashavarlamov.com> | 2017-12-07 14:00:09 +0700 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-12-07 15:00:09 +0800 |
commit | 311c83ad17c718f1b81c94f84307b4288c90e374 (patch) | |
tree | a2d962fdeb7637d5f02351abac58584eb0ef90ec /routers/repo/setting.go | |
parent | 7ec6cddd27f36f50f06669b208674feb0dc19535 (diff) | |
download | gitea-311c83ad17c718f1b81c94f84307b4288c90e374.tar.gz gitea-311c83ad17c718f1b81c94f84307b4288c90e374.zip |
Allow adding collaborators with (fullname) (#3103)
* Allow adding collaborators with (fullname)
Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>
* Refactor username suffix to utils pkg
Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r-- | routers/repo/setting.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 5586e81f05..16cc699ae2 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -16,6 +16,7 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/routers/utils" ) const ( @@ -366,7 +367,7 @@ func Collaboration(ctx *context.Context) { // CollaborationPost response for actions for a collaboration of a repository func CollaborationPost(ctx *context.Context) { - name := strings.ToLower(ctx.Query("collaborator")) + name := utils.RemoveUsernameParameterSuffix(strings.ToLower(ctx.Query("collaborator"))) if len(name) == 0 || ctx.Repo.Owner.LowerName == name { ctx.Redirect(setting.AppSubURL + ctx.Req.URL.Path) return |