mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound * Change Handle(403) to NotFound, avoid using macaron's NotFound
This commit is contained in:
parent
45c264f681
commit
65861900cd
48 changed files with 622 additions and 610 deletions
|
@ -20,7 +20,7 @@ func AddTimeManually(c *context.Context, form auth.AddTimeManuallyForm) {
|
|||
return
|
||||
}
|
||||
if !c.Repo.CanUseTimetracker(issue, c.User) {
|
||||
c.Handle(http.StatusNotFound, "CanUseTimetracker", nil)
|
||||
c.NotFound("CanUseTimetracker", nil)
|
||||
return
|
||||
}
|
||||
url := issue.HTMLURL()
|
||||
|
@ -40,7 +40,7 @@ func AddTimeManually(c *context.Context, form auth.AddTimeManuallyForm) {
|
|||
}
|
||||
|
||||
if _, err := models.AddTime(c.User, issue, int64(total.Seconds())); err != nil {
|
||||
c.Handle(http.StatusInternalServerError, "AddTime", err)
|
||||
c.ServerError("AddTime", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue