aboutsummaryrefslogtreecommitdiff
path: root/models/user.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-22 00:48:26 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-22 00:48:26 +0800
commitefdaf6ee1536f043d9e242dc16a096c99ec1bfda (patch)
treec2aac787780b7a8e1925e0b4536ae735f7d3680b /models/user.go
parent5cb2d3d2e233def07d6956af47dfc49acc45c7e6 (diff)
add http protocol clone support
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