1
0
Fork 0
forked from forgejo/forgejo

add http protocol clone support

This commit is contained in:
Lunny Xiao 2014-03-22 00:48:26 +08:00
parent 5cb2d3d2e2
commit efdaf6ee15
4 changed files with 40 additions and 4 deletions

View file

@ -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