aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-21 16:43:36 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-21 16:45:19 -0800
commit86f37a5df6f94d7736be736d0a440ae65425d6c9 (patch)
tree768e392c65e78e248edd68ad7c58440db9ad2168
parente55a408384f3452e9bb14da8933ad89c11ba77b5 (diff)
downloadfatcat-86f37a5df6f94d7736be736d0a440ae65425d6c9.tar.gz
fatcat-86f37a5df6f94d7736be736d0a440ae65425d6c9.zip
clarify expand of non-concrete release
-rw-r--r--rust/src/api_entity_crud.rs7
1 files 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!