@@ -29,6 +29,8 @@ import (
2929
3030var  ErrMustCollaborator  =  util .NewPermissionDeniedErrorf ("user must be a collaborator" )
3131
32+ const  reviewedBy  =  "Reviewed-by: " 
33+ 
3234// ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error. 
3335type  ErrPullRequestNotExist  struct  {
3436	ID          int64 
@@ -348,7 +350,11 @@ type ReviewCount struct {
348350func  (pr  * PullRequest ) GetApprovalCounts (ctx  context.Context ) ([]* ReviewCount , error ) {
349351	rCounts  :=  make ([]* ReviewCount , 0 , 6 )
350352	sess  :=  db .GetEngine (ctx ).Where ("issue_id = ?" , pr .IssueID )
351- 	return  rCounts , sess .Select ("issue_id, type, count(id) as `count`" ).Where ("official = ? AND dismissed = ?" , true , false ).GroupBy ("issue_id, type" ).Table ("review" ).Find (& rCounts )
353+ 	return  rCounts , sess .Select ("issue_id, type, count(id) as `count`" ).
354+ 		Where (builder.Eq {"official" : true , "dismissed" : false }).
355+ 		GroupBy ("issue_id, type" ).
356+ 		Table ("review" ).
357+ 		Find (& rCounts )
352358}
353359
354360// GetApprovers returns the approvers of the pull request 
@@ -392,7 +398,7 @@ func (pr *PullRequest) getReviewedByLines(ctx context.Context, writer io.Writer)
392398		} else  if  review .Reviewer  ==  nil  {
393399			continue 
394400		}
395- 		if  _ , err  :=  writer .Write ([]byte ("Reviewed-by: " )); err  !=  nil  {
401+ 		if  _ , err  :=  writer .Write ([]byte (reviewedBy )); err  !=  nil  {
396402			return  err 
397403		}
398404		if  _ , err  :=  writer .Write ([]byte (review .Reviewer .NewGitSig ().String ())); err  !=  nil  {
0 commit comments