cob: Fix compatibility with certain old patches

We were rejecting patches that were once valid, due to a rule that was
added some time ago. Move that rule one level up, in the write path,
instead of in the read path.
This commit is contained in:
cloudhead 2024-11-04 14:34:30 +01:00
parent 6dcfbfcdee
commit 0bb0fe8f25
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -864,9 +864,6 @@ impl Patch {
// If the revision was redacted concurrently, there's nothing to do.
return Ok(());
};
if summary.is_none() && verdict.is_none() {
return Err(Error::EmptyReview);
}
if let Some(rev) = rev {
// Insert a review if there isn't already one. Otherwise we just ignore
// this operation
@ -2173,6 +2170,9 @@ where
labels: Vec<Label>,
signer: &G,
) -> Result<ReviewId, Error> {
if verdict.is_none() && summary.is_none() {
return Err(Error::EmptyReview);
}
self.transaction("Review", signer, |tx| {
tx.review(revision, verdict, summary, labels)
})