diff options
author | Thibault Meyer <meyer.thibault@gmail.com> | 2016-11-10 16:16:32 +0100 |
---|---|---|
committer | Thibault Meyer <meyer.thibault@gmail.com> | 2016-11-10 20:59:51 +0100 |
commit | a4454f5d0fbeaacb94668012acbb4296465cb28f (patch) | |
tree | eaf39d1935eda44cf16df08234d2bbddd39c3ddd /models/admin.go | |
parent | c040f2fbb13ef5ba2c6a619322d4801e9f78c885 (diff) | |
download | gitea-a4454f5d0fbeaacb94668012acbb4296465cb28f.tar.gz gitea-a4454f5d0fbeaacb94668012acbb4296465cb28f.zip |
Rewrite XORM queries
Diffstat (limited to 'models/admin.go')
-rw-r--r-- | models/admin.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/models/admin.go b/models/admin.go index dab92863a5..df4a7f54be 100644 --- a/models/admin.go +++ b/models/admin.go @@ -103,7 +103,10 @@ func CountNotices() int64 { // Notices returns number of notices in given page. func Notices(page, pageSize int) ([]*Notice, error) { notices := make([]*Notice, 0, pageSize) - return notices, x.Limit(pageSize, (page-1)*pageSize).Desc("id").Find(¬ices) + return notices, x. + Limit(pageSize, (page-1)*pageSize). + Desc("id"). + Find(¬ices) } // DeleteNotice deletes a system notice by given ID. @@ -127,6 +130,8 @@ func DeleteNoticesByIDs(ids []int64) error { if len(ids) == 0 { return nil } - _, err := x.Where("id IN (" + strings.Join(base.Int64sToStrings(ids), ",") + ")").Delete(new(Notice)) + _, err := x. + Where("id IN (" + strings.Join(base.Int64sToStrings(ids), ",") + ")"). + Delete(new(Notice)) return err } |