diff --git a/server/src/web.rs b/server/src/web.rs index 01331fd..27ca12f 100644 --- a/server/src/web.rs +++ b/server/src/web.rs @@ -406,10 +406,6 @@ fn stats_seven_days(state: Arc) -> BoxedFilter<(impl Reply, )> { fn contribute(state: Arc) -> BoxedFilter<(impl Reply, )> { async fn logic(state: Arc, listing: PartyFinderListing) -> std::result::Result { - if listing.created_world >= 1_000 || listing.home_world >= 1_000 || listing.current_world >= 1_000 { - return Ok("invalid listing".to_string()); - } - if listing.seconds_remaining > 60 * 60 { return Ok("invalid listing".to_string()); } @@ -455,6 +451,10 @@ fn contribute_multiple(state: Arc) -> BoxedFilter<(impl Reply, )> { } async fn insert_listing(state: &State, mut listing: PartyFinderListing) -> mongodb::error::Result { + if listing.created_world >= 1_000 || listing.home_world >= 1_000 || listing.current_world >= 1_000 { + anyhow::bail!("invalid listing"); + } + let opts = UpdateOptions::builder() .upsert(true) .build();