mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-26 23:09:28 +00:00
Fix #167
This commit is contained in:
parent
914ffa496f
commit
25713ab209
|
@ -44,6 +44,10 @@ type Issue struct {
|
||||||
|
|
||||||
func (i *Issue) GetPoster() (err error) {
|
func (i *Issue) GetPoster() (err error) {
|
||||||
i.Poster, err = GetUserById(i.PosterId)
|
i.Poster, err = GetUserById(i.PosterId)
|
||||||
|
if err == ErrUserNotExist {
|
||||||
|
i.Poster = &User{Name: "FakeUser"}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,12 +33,10 @@ func Issues(ctx *middleware.Context) {
|
||||||
|
|
||||||
isShowClosed := ctx.Query("state") == "closed"
|
isShowClosed := ctx.Query("state") == "closed"
|
||||||
|
|
||||||
if viewType != "all" {
|
if viewType != "all" && !ctx.IsSigned {
|
||||||
if !ctx.IsSigned {
|
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(ctx.Req.RequestURI))
|
||||||
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(ctx.Req.RequestURI))
|
ctx.Redirect("/user/login")
|
||||||
ctx.Redirect("/user/login")
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var assigneeId, posterId int64
|
var assigneeId, posterId int64
|
||||||
|
@ -87,7 +85,7 @@ func Issues(ctx *middleware.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = issues[i].GetPoster(); err != nil {
|
if err = issues[i].GetPoster(); err != nil {
|
||||||
ctx.Handle(500, "issue.Issues(GetPoster): %v", err)
|
ctx.Handle(500, "issue.Issues(GetPoster)", fmt.Errorf("[#%d]%v", issues[i].Id, err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,11 @@ func Profile(ctx *middleware.Context, params martini.Params) {
|
||||||
|
|
||||||
user, err := models.GetUserByName(params["username"])
|
user, err := models.GetUserByName(params["username"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Handle(500, "user.Profile", err)
|
if err == models.ErrUserNotExist {
|
||||||
|
ctx.Handle(404, "user.Profile", err)
|
||||||
|
} else {
|
||||||
|
ctx.Handle(500, "user.Profile", err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue