mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-22 14:52:17 +01:00
bug fix
This commit is contained in:
parent
fcfa009cad
commit
db9347135c
@ -77,7 +77,7 @@ func (p *ProjectAPI) Post() {
|
||||
err := validateProjectReq(req)
|
||||
if err != nil {
|
||||
log.Errorf("Invalid project request, error: %v", err)
|
||||
p.RenderError(http.StatusBadRequest, "Invalid request for creating project")
|
||||
p.RenderError(http.StatusBadRequest, fmt.Sprintf("invalid request: %v", err))
|
||||
return
|
||||
}
|
||||
projectName := req.ProjectName
|
||||
|
@ -139,7 +139,7 @@ func (pa *RepPolicyAPI) Put() {
|
||||
pa.CustomAbort(http.StatusNotFound, http.StatusText(http.StatusNotFound))
|
||||
}
|
||||
|
||||
var policy *models.RepPolicy
|
||||
policy := &models.RepPolicy{}
|
||||
pa.DecodeJSONReq(policy)
|
||||
policy.ProjectID = originalPolicy.ProjectID
|
||||
policy.TargetID = originalPolicy.TargetID
|
||||
|
@ -58,7 +58,7 @@ func DeleteProjectMember(projectID int64, userID int) error {
|
||||
func GetUserByProject(projectID int64, queryUser models.User) ([]models.User, error) {
|
||||
o := GetOrmer()
|
||||
u := []models.User{}
|
||||
sql := `select u.user_id, u.username, r.name rolename, r.role_id
|
||||
sql := `select u.user_id, u.username, r.name rolename, r.role_id as role
|
||||
from user u
|
||||
join project_member pm
|
||||
on pm.project_id = ? and u.user_id = pm.user_id
|
||||
|
@ -29,7 +29,9 @@ type User struct {
|
||||
Comment string `orm:"column(comment)" json:"comment"`
|
||||
Deleted int `orm:"column(deleted)" json:"deleted"`
|
||||
Rolename string `json:"role_name"`
|
||||
RoleID int `json:"role_id"`
|
||||
//if this field is named as "RoleID", beego orm can not map role_id
|
||||
//to it.
|
||||
Role int `json:"role_id"`
|
||||
// RoleList []Role `json:"role_list"`
|
||||
HasAdminRole int `orm:"column(sysadmin_flag)" json:"has_admin_role"`
|
||||
ResetUUID string `orm:"column(reset_uuid)" json:"reset_uuid"`
|
||||
|
Loading…
Reference in New Issue
Block a user