modify conficts

This commit is contained in:
wemeya 2016-05-25 15:45:30 +08:00
parent ad9d80aee9
commit bf3e6ed8cf
3 changed files with 4 additions and 14 deletions

View File

@ -18,6 +18,8 @@ package dao
import (
"strings"
"github.com/astaxie/beego/orm"
"github.com/vmware/harbor/models"
"github.com/vmware/harbor/utils/log"
)
@ -130,7 +132,7 @@ func GetRecentLogs(lines int, startTime, endTime string) ([]models.AccessLog, er
OrderBy("op_time").Desc().
Limit(lines)
sql := qb.String()
o := orm.NewOrm()
o := GetOrmer()
_, err := o.Raw(sql, queryParam).QueryRows(&recentLogList)
if err != nil {
return nil, err

View File

@ -28,20 +28,8 @@ import (
// AddProject adds a project to the database along with project roles information and access log records.
func AddProject(project models.Project) (int64, error) {
<<<<<<< HEAD
o := orm.NewOrm()
=======
if isIllegalLength(project.Name, 4, 30) {
return 0, errors.New("project name is illegal in length. (greater than 4 or less than 30)")
}
if isContainIllegalChar(project.Name, []string{"~", "-", "$", "\\", "[", "]", "{", "}", "(", ")", "&", "^", "%", "*", "<", ">", "\"", "'", "/", "?", "@"}) {
return 0, errors.New("project name contains illegal characters")
}
o := GetOrmer()
>>>>>>> upstream/master
p, err := o.Raw("insert into project (owner_id, name, creation_time, update_time, deleted, public) values (?, ?, ?, ?, ?, ?)").Prepare()
if err != nil {
return 0, err

View File

@ -232,7 +232,7 @@ func DeleteUser(userID int) error {
// ChangeUserProfile ...
func ChangeUserProfile(user models.User) error {
o := orm.NewOrm()
o := GetOrmer()
if _, err := o.Update(&user, "Email", "Realname", "Comment"); err != nil {
log.Errorf("update user failed, error: %v", err)
return err