ReviewerPredicate: Filter out draft changes when DRAFT workflow is disabled

Change-Id: Icd11184d893d0a32c2112534d05f053acdf8a700
This commit is contained in:
David Ostrovsky
2014-01-29 08:25:23 +01:00
parent 945fbd4bea
commit 58aa6d58ab
6 changed files with 33 additions and 7 deletions

View File

@@ -215,6 +215,10 @@ public class ChangeField {
public Iterable<Integer> get(ChangeData input, FillArgs args)
throws OrmException {
Set<Integer> r = Sets.newHashSet();
if (!args.allowsDrafts &&
input.change().getStatus() == Change.Status.DRAFT) {
return r;
}
for (PatchSetApproval a : input.approvals().values()) {
r.add(a.getAccountId().get());
}