]> source.dussan.org Git - gitea.git/commitdiff
Remove redudant issue LoadAttributes() calls (#2614)
authorMorlinest <Morlinest@users.noreply.github.com>
Wed, 27 Sep 2017 12:41:52 +0000 (14:41 +0200)
committerAndrey Nering <andrey.nering@gmail.com>
Wed, 27 Sep 2017 12:41:52 +0000 (09:41 -0300)
models/issue.go
routers/api/v1/repo/issue.go

index 7884507a2721a60b4fc3d2ded4b06f0c8d65f693..0c68275d41a77ca5a74f686f71480d8720c25015 100644 (file)
@@ -984,12 +984,7 @@ func GetIssueByRef(ref string) (*Issue, error) {
                return nil, err
        }
 
-       issue, err := GetIssueByIndex(repo.ID, index)
-       if err != nil {
-               return nil, err
-       }
-
-       return issue, issue.LoadAttributes()
+       return GetIssueByIndex(repo.ID, index)
 }
 
 // GetRawIssueByIndex returns raw issue without loading attributes by index in a repository.
index 9f51022f35492e8ff73492639f7887d587669f39..2debe67c3b67c016a091f1deb095012ed6c024cf 100644 (file)
@@ -39,12 +39,6 @@ func ListIssues(ctx *context.APIContext) {
                return
        }
 
-       err = models.IssueList(issues).LoadAttributes()
-       if err != nil {
-               ctx.Error(500, "LoadAttributes", err)
-               return
-       }
-
        apiIssues := make([]*api.Issue, len(issues))
        for i := range issues {
                apiIssues[i] = issues[i].APIFormat()