diff options
Diffstat (limited to 'models/release.go')
-rw-r--r-- | models/release.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/models/release.go b/models/release.go index 66202615d2..586f494e7d 100644 --- a/models/release.go +++ b/models/release.go @@ -53,7 +53,7 @@ func (r *Release) loadAttributes(e Engine) error { return err } } - return nil + return GetReleaseAttachments(r) } // LoadAttributes load repo and publisher attributes for a release @@ -79,6 +79,10 @@ func (r *Release) TarURL() string { // APIFormat convert a Release to api.Release func (r *Release) APIFormat() *api.Release { + assets := make([]*api.Attachment, 0) + for _, att := range r.Attachments { + assets = append(assets, att.APIFormat()) + } return &api.Release{ ID: r.ID, TagName: r.TagName, @@ -92,6 +96,7 @@ func (r *Release) APIFormat() *api.Release { CreatedAt: r.CreatedUnix.AsTime(), PublishedAt: r.CreatedUnix.AsTime(), Publisher: r.Publisher.APIFormat(), + Attachments: assets, } } |