aboutsummaryrefslogtreecommitdiff
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/models/user.go b/models/user.go
index 76cf2d20..69608ec2 100644
--- a/models/user.go
+++ b/models/user.go
@@ -231,10 +231,8 @@ func UserPath(userName string) string {
func GetUserByKeyId(keyId int64) (*User, error) {
user := new(User)
- rawSql := "SELECT a.* FROM user AS a, public_key AS b WHERE a.id = b.owner_id AND b.id=?"
- if base.Cfg.MustValue("database", "DB_TYPE") == "postgres" {
- rawSql = "SELECT a.* FROM \"user\" AS a, public_key AS b WHERE a.id = b.owner_id AND b.id=?"
- }
+ rawSql := "SELECT a.* FROM `user` AS a, public_key AS b WHERE a.id = b.owner_id AND b.id=?"
+
has, err := orm.Sql(rawSql, keyId).Get(user)
if err != nil {
return nil, err