aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-21 16:37:45 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-21 16:37:45 -0800
commitb2cb78c023670d61e915db1d3341e808940a2197 (patch)
treecf1289401c6d6b7f0d124e0a37c42f978cf9b6c1
parentc350cb5eddf369a2ed002401e756cf91de5a04ff (diff)
downloadfatcat-b2cb78c023670d61e915db1d3341e808940a2197.tar.gz
fatcat-b2cb78c023670d61e915db1d3341e808940a2197.zip
don't expand deleted entities
-rw-r--r--rust/src/api_entity_crud.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/rust/src/api_entity_crud.rs b/rust/src/api_entity_crud.rs
index eb7a3ac9..6474ba6f 100644
--- a/rust/src/api_entity_crud.rs
+++ b/rust/src/api_entity_crud.rs
@@ -1014,6 +1014,10 @@ impl EntityCrud for ReleaseEntity {
}
fn db_expand(&mut self, conn: &DbConn, expand: ExpandFlags) -> Result<()> {
+ // Don't expand deleted entities
+ if self.state == Some("deleted".to_string()) {
+ return Ok(())
+ }
if expand.files {
let ident = match &self.ident {
None => bail!("Can't expand files on a non-concrete entity"),