From 86f37a5df6f94d7736be736d0a440ae65425d6c9 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 21 Dec 2018 16:43:36 -0800 Subject: clarify expand of non-concrete release --- rust/src/api_entity_crud.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust/src/api_entity_crud.rs b/rust/src/api_entity_crud.rs index 151f0502..2f28e858 100644 --- a/rust/src/api_entity_crud.rs +++ b/rust/src/api_entity_crud.rs @@ -1018,9 +1018,12 @@ impl EntityCrud for ReleaseEntity { if self.state == Some("deleted".to_string()) { return Ok(()) } - if expand.files { + // TODO: should clarify behavior here. Would hit this path, eg, expanding files on a + // release revision (not ident). Should we fail (Bad Request), or silently just not include + // any files? + if expand.files && self.ident.is_some() { let ident = match &self.ident { - None => bail!("Can't expand files on a non-concrete entity"), + None => bail!("Can't expand files on a non-concrete entity"), // redundant with above is_some() Some(ident) => match &self.redirect { // If we're a redirect, then expand for the *target* identifier, not *our* // identifier. Tricky! -- cgit v1.2.3