summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue_timetrack.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-10-16 10:55:43 +0300
committerGitHub <noreply@github.com>2017-10-16 10:55:43 +0300
commitc1b0c9e7c4bbb669ea03694c30c9ff66a109ef17 (patch)
tree06c50be163dfa85264a72b54393eb29aa0f4128c /routers/repo/issue_timetrack.go
parenta75d5c72bb9d85b2344ee98b4425290423b6e6b2 (diff)
downloadgitea-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.go14
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()