mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-20 22:02:32 +01:00
modify conficts
This commit is contained in:
parent
ad9d80aee9
commit
bf3e6ed8cf
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user