forked from forgejo/forgejo
Mirror changes
This commit is contained in:
parent
0d6856dbe7
commit
48bfbb7ddf
5 changed files with 11 additions and 8 deletions
|
@ -51,11 +51,14 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
|
|||
if !ctx.Repo.IsOwner {
|
||||
user, err = models.GetUserByName(params["username"])
|
||||
if err != nil {
|
||||
if redirect {
|
||||
if err == models.ErrUserNotExist {
|
||||
ctx.Handle(404, "RepoAssignment", err)
|
||||
return
|
||||
} else if redirect {
|
||||
ctx.Redirect("/")
|
||||
return
|
||||
}
|
||||
ctx.Handle(200, "RepoAssignment", err)
|
||||
ctx.Handle(500, "RepoAssignment", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
@ -67,7 +70,7 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
|
|||
ctx.Redirect("/")
|
||||
return
|
||||
}
|
||||
ctx.Handle(200, "RepoAssignment", errors.New("invliad user account for single repository"))
|
||||
ctx.Handle(403, "RepoAssignment", errors.New("invliad user account for single repository"))
|
||||
return
|
||||
}
|
||||
ctx.Repo.Owner = user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue