diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-04-08 17:11:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 17:11:15 +0800 |
commit | 1dfa26e00e8e1ce6f6125335871da1d402a63466 (patch) | |
tree | d39414fb085ae52d6633ae9d064aabab2e7f75f8 /routers/web/repo/issue_stopwatch.go | |
parent | 84ceaa98bd731431c7d3a7f65e59e7ad076a540f (diff) | |
download | gitea-1dfa26e00e8e1ce6f6125335871da1d402a63466.tar.gz gitea-1dfa26e00e8e1ce6f6125335871da1d402a63466.zip |
Move milestone to models/issues/ (#19278)
* Move milestone to models/issues/
* Fix lint
* Fix test
* Fix lint
* Fix lint
Diffstat (limited to 'routers/web/repo/issue_stopwatch.go')
-rw-r--r-- | routers/web/repo/issue_stopwatch.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/routers/web/repo/issue_stopwatch.go b/routers/web/repo/issue_stopwatch.go index 8e8f9555a3..7ef80e7725 100644 --- a/routers/web/repo/issue_stopwatch.go +++ b/routers/web/repo/issue_stopwatch.go @@ -64,18 +64,18 @@ func CancelStopwatch(c *context.Context) { } // GetActiveStopwatch is the middleware that sets .ActiveStopwatch on context -func GetActiveStopwatch(c *context.Context) { - if strings.HasPrefix(c.Req.URL.Path, "/api") { +func GetActiveStopwatch(ctx *context.Context) { + if strings.HasPrefix(ctx.Req.URL.Path, "/api") { return } - if !c.IsSigned { + if !ctx.IsSigned { return } - _, sw, err := models.HasUserStopwatch(c.Doer.ID) + _, sw, err := models.HasUserStopwatch(ctx.Doer.ID) if err != nil { - c.ServerError("HasUserStopwatch", err) + ctx.ServerError("HasUserStopwatch", err) return } @@ -85,15 +85,15 @@ func GetActiveStopwatch(c *context.Context) { issue, err := models.GetIssueByID(sw.IssueID) if err != nil || issue == nil { - c.ServerError("GetIssueByID", err) + ctx.ServerError("GetIssueByID", err) return } - if err = issue.LoadRepo(); err != nil { - c.ServerError("LoadRepo", err) + if err = issue.LoadRepo(ctx); err != nil { + ctx.ServerError("LoadRepo", err) return } - c.Data["ActiveStopwatch"] = StopwatchTmplInfo{ + ctx.Data["ActiveStopwatch"] = StopwatchTmplInfo{ issue.Link(), issue.Repo.FullName(), issue.Index, |