Merge pull request #1630 from ywk253100/170316_fix_search_bug

Fix search bug
This commit is contained in:
Daniel Jiang 2017-03-16 16:58:35 +08:00 committed by GitHub
commit 695c7041b8

View File

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