mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 09:55:20 +02:00
Move milestone to models/issues/ (#19278)
* Move milestone to models/issues/ * Fix lint * Fix test * Fix lint * Fix lint
This commit is contained in:
parent
84ceaa98bd
commit
1dfa26e00e
56 changed files with 466 additions and 447 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue