Skip to content

Commit 136e6be

Browse files
ethantkoeniglunny
authored andcommitted
Fix unused Engine bugs (#1064)
1 parent 5091808 commit 136e6be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

models/attachment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func NewAttachment(name string, buf []byte, file multipart.File) (_ *Attachment,
8989

9090
func getAttachmentByUUID(e Engine, uuid string) (*Attachment, error) {
9191
attach := &Attachment{UUID: uuid}
92-
has, err := x.Get(attach)
92+
has, err := e.Get(attach)
9393
if err != nil {
9494
return nil, err
9595
} else if !has {

models/repo.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,15 +1734,15 @@ func GetUserMirrorRepositories(userID int64) ([]*Repository, error) {
17341734
}
17351735

17361736
func getRepositoryCount(e Engine, u *User) (int64, error) {
1737-
return x.Count(&Repository{OwnerID: u.ID})
1737+
return e.Count(&Repository{OwnerID: u.ID})
17381738
}
17391739

17401740
func getPublicRepositoryCount(e Engine, u *User) (int64, error) {
1741-
return x.Where("is_private = ?", false).Count(&Repository{OwnerID: u.ID})
1741+
return e.Where("is_private = ?", false).Count(&Repository{OwnerID: u.ID})
17421742
}
17431743

17441744
func getPrivateRepositoryCount(e Engine, u *User) (int64, error) {
1745-
return x.Where("is_private = ?", true).Count(&Repository{OwnerID: u.ID})
1745+
return e.Where("is_private = ?", true).Count(&Repository{OwnerID: u.ID})
17461746
}
17471747

17481748
// GetRepositoryCount returns the total number of repositories of user.

0 commit comments

Comments
 (0)