Submit: Reuse db in problemsForSubmittingChangeset

Change-Id: I80451a28a32564d28a292a58663976a05ce80561
This commit is contained in:
Stefan Beller 2015-07-30 11:20:08 -07:00
parent 55adf1e640
commit b891a8e4c8

View File

@ -212,13 +212,13 @@ public class Submit implements RestModifyView<RevisionResource, SubmitInput>,
private String problemsForSubmittingChangeset(
ChangeSet cs, IdentifiedUser identifiedUser) {
try {
ReviewDb db = dbProvider.get();
for (PatchSet.Id psId : cs.patchIds()) {
ReviewDb db = dbProvider.get();
ChangeControl changeControl = changeControlFactory
.controlFor(psId.getParentKey(), identifiedUser);
ChangeData c = changeDataFactory.create(db, changeControl);
if (!changeControl.isVisible(dbProvider.get())) {
if (!changeControl.isVisible(db)) {
return BLOCKED_HIDDEN_SUBMIT_TOOLTIP;
}
if (!changeControl.canSubmit()) {