diff --git a/api/project.go b/api/project.go index cd65dce5f..0a80db759 100644 --- a/api/project.go +++ b/api/project.go @@ -100,6 +100,10 @@ func (p *ProjectAPI) Post() { // Head ... func (p *ProjectAPI) Head() { projectName := p.GetString("project_name") + if len(projectName) == 0 { + p.CustomAbort(http.StatusBadRequest, "project_name is needed") + } + project, err := dao.GetProjectByName(projectName) if err != nil { log.Errorf("error occurred in GetProjectByName: %v", err) diff --git a/dao/project.go b/dao/project.go index 730b1f331..399cad6aa 100644 --- a/dao/project.go +++ b/dao/project.go @@ -250,7 +250,6 @@ func getProjects(public int, projectName string) ([]models.Project, error) { } sql += " order by name " var projects []models.Project - log.Debugf("sql xxx", sql) if _, err := o.Raw(sql, queryParam).QueryRows(&projects); err != nil { return nil, err }