fix search bug

This commit is contained in:
Wenkai Yin 2017-03-16 16:26:04 +08:00
parent bd0d935bca
commit 20e764636b

View File

@ -86,7 +86,9 @@ func (s *SearchAPI) Get() {
log.Errorf("failed to get user's project role: %v", err)
s.CustomAbort(http.StatusInternalServerError, "")
}
p.Role = roles[0].RoleID
if len(roles) != 0 {
p.Role = roles[0].RoleID
}
}
if p.Role == models.PROJECTADMIN {