This commit is contained in:
Wenkai Yin 2017-04-07 19:47:08 +08:00
parent 746667bb38
commit 5c2bd7eecc

View File

@ -302,7 +302,10 @@ func (p *ProjectAPI) List() {
log.Errorf("failed to get user's project role: %v", err)
p.CustomAbort(http.StatusInternalServerError, "")
}
projectList[i].Role = roles[0].RoleID
if len(roles) != 0 {
projectList[i].Role = roles[0].RoleID
}
if projectList[i].Role == models.PROJECTADMIN ||
isAdmin {
projectList[i].Togglable = true