aboutsummaryrefslogtreecommitdiffstats
path: root/models/release.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/release.go')
-rw-r--r--models/release.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/models/release.go b/models/release.go
index 69d2ceda5e..f60024c710 100644
--- a/models/release.go
+++ b/models/release.go
@@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
@@ -24,12 +25,12 @@ import (
// Release represents a release of repository.
type Release struct {
- ID int64 `xorm:"pk autoincr"`
- RepoID int64 `xorm:"INDEX UNIQUE(n)"`
- Repo *Repository `xorm:"-"`
- PublisherID int64 `xorm:"INDEX"`
- Publisher *User `xorm:"-"`
- TagName string `xorm:"INDEX UNIQUE(n)"`
+ ID int64 `xorm:"pk autoincr"`
+ RepoID int64 `xorm:"INDEX UNIQUE(n)"`
+ Repo *Repository `xorm:"-"`
+ PublisherID int64 `xorm:"INDEX"`
+ Publisher *user_model.User `xorm:"-"`
+ TagName string `xorm:"INDEX UNIQUE(n)"`
OriginalAuthor string
OriginalAuthorID int64 `xorm:"index"`
LowerTagName string
@@ -60,10 +61,10 @@ func (r *Release) loadAttributes(e db.Engine) error {
}
}
if r.Publisher == nil {
- r.Publisher, err = getUserByID(e, r.PublisherID)
+ r.Publisher, err = user_model.GetUserByIDEngine(e, r.PublisherID)
if err != nil {
- if IsErrUserNotExist(err) {
- r.Publisher = NewGhostUser()
+ if user_model.IsErrUserNotExist(err) {
+ r.Publisher = user_model.NewGhostUser()
} else {
return err
}