diff options
author | Lauris BH <lauris@nix.lv> | 2017-10-16 10:55:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-16 10:55:43 +0300 |
commit | c1b0c9e7c4bbb669ea03694c30c9ff66a109ef17 (patch) | |
tree | 06c50be163dfa85264a72b54393eb29aa0f4128c /routers/repo/issue_timetrack.go | |
parent | a75d5c72bb9d85b2344ee98b4425290423b6e6b2 (diff) | |
download | gitea-c1b0c9e7c4bbb669ea03694c30c9ff66a109ef17.tar.gz gitea-c1b0c9e7c4bbb669ea03694c30c9ff66a109ef17.zip |
Fix PR, milestone and label functionality if issue unit is disabled (#2710)
* Fix PR, milestone and label functionality if issue unit is disabled or not assigned to user
* Fix multi-actions in PR page
* Change error message
* Fix comment update and delete functionality in PR
Diffstat (limited to 'routers/repo/issue_timetrack.go')
-rw-r--r-- | routers/repo/issue_timetrack.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/routers/repo/issue_timetrack.go b/routers/repo/issue_timetrack.go index 4d77ca3cea..d89c67b497 100644 --- a/routers/repo/issue_timetrack.go +++ b/routers/repo/issue_timetrack.go @@ -15,14 +15,12 @@ import ( // AddTimeManually tracks time manually func AddTimeManually(c *context.Context, form auth.AddTimeManuallyForm) { - issueIndex := c.ParamsInt64("index") - issue, err := models.GetIssueByIndex(c.Repo.Repository.ID, issueIndex) - if err != nil { - if models.IsErrIssueNotExist(err) { - c.Handle(http.StatusNotFound, "GetIssueByIndex", err) - return - } - c.Handle(http.StatusInternalServerError, "GetIssueByIndex", err) + issue := GetActionIssue(c) + if c.Written() { + return + } + if !c.Repo.CanUseTimetracker(issue, c.User) { + c.Handle(http.StatusNotFound, "CanUseTimetracker", nil) return } url := issue.HTMLURL() |