mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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>
This commit is contained in:
committed by
Lunny Xiao
parent
7ec6cddd27
commit
311c83ad17
@@ -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
|
||||
|
Reference in New Issue
Block a user