summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-07-20 05:10:17 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2018-07-20 10:10:17 +0800
commit0c59edaafa94738b8eaec1620f20887cc35d90e2 (patch)
tree344496bf031508008428db4b9537a68953a44320 /models/user.go
parent1e2da5d396141c9c240151d8736862f7d04aa46f (diff)
downloadgitea-0c59edaafa94738b8eaec1620f20887cc35d90e2.tar.gz
gitea-0c59edaafa94738b8eaec1620f20887cc35d90e2.zip
Update xorm to latest version and fix correct `user` table referencing in sql (#4473)
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/user.go b/models/user.go
index 0b7af8df6d..32b9bfec9b 100644
--- a/models/user.go
+++ b/models/user.go
@@ -374,9 +374,9 @@ func (u *User) GetFollowers(page int) ([]*User, error) {
Limit(ItemsPerPage, (page-1)*ItemsPerPage).
Where("follow.follow_id=?", u.ID)
if setting.UsePostgreSQL {
- sess = sess.Join("LEFT", "follow", `"user".id=follow.user_id`)
+ sess = sess.Join("LEFT", "follow", "`user`.id=follow.user_id")
} else {
- sess = sess.Join("LEFT", "follow", "user.id=follow.user_id")
+ sess = sess.Join("LEFT", "follow", "`user`.id=follow.user_id")
}
return users, sess.Find(&users)
}
@@ -393,9 +393,9 @@ func (u *User) GetFollowing(page int) ([]*User, error) {
Limit(ItemsPerPage, (page-1)*ItemsPerPage).
Where("follow.user_id=?", u.ID)
if setting.UsePostgreSQL {
- sess = sess.Join("LEFT", "follow", `"user".id=follow.follow_id`)
+ sess = sess.Join("LEFT", "follow", "`user`.id=follow.follow_id")
} else {
- sess = sess.Join("LEFT", "follow", "user.id=follow.follow_id")
+ sess = sess.Join("LEFT", "follow", "`user`.id=follow.follow_id")
}
return users, sess.Find(&users)
}