Unify logic for validating draft deletions

This change makes validating draft deletions the same
as draft publishings.

Change-Id: I9ef00d6382c60ce28c1c002fc2c4733ac129e716
This commit is contained in:
Conley Owens
2012-02-06 08:31:47 -08:00
parent 388ba60191
commit d88539c11c
5 changed files with 21 additions and 21 deletions

View File

@@ -255,7 +255,7 @@ public class ReviewCommand extends BaseCommand {
ReviewResult result = publishDraftFactory.create(patchSetId).call();
handleReviewResultErrors(result);
} else if (deleteDraftPatchSet) {
if (changeControl.isOwner() && changeControl.isVisible(db)) {
if (changeControl.canDelete(db)) {
try {
ChangeUtil.deleteDraftPatchSet(patchSetId, gitManager, replication, patchSetInfoFactory, db);
} catch (PatchSetInfoNotAvailableException e) {