diff --git a/Cargo.lock b/Cargo.lock index 5636714..df623d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -578,7 +578,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fabula_votes_server" -version = "1.2.0" +version = "1.2.1" dependencies = [ "argon2", "blake2", diff --git a/Cargo.toml b/Cargo.toml index c900b9a..2ec545f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "fabula_votes_server" license = "MPL-2.0" readme = "README.md" authors = ["trotFunky"] -version = "1.2.0" +version = "1.2.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/vote.rs b/src/vote.rs index f3becde..6795167 100644 --- a/src/vote.rs +++ b/src/vote.rs @@ -113,8 +113,7 @@ pub async fn fetch_vote_data(week: u8, mut db: Connection) -> Opti let vote_count = raw_votes.iter().fold(0, |count, votes| {count + votes.votes}); // Only show the graph if we have all the votes and this is not the last week. // FIXME: Make the 42 not hardcoded - if vote_count < 42 || week != sqlx::query_scalar("SELECT number from Weeks WHERE number == $1 AND is_last_week == 1;") - .bind(week) + if vote_count < 42 || week == sqlx::query_scalar("SELECT number from Weeks WHERE is_last_week == 1;") .fetch_optional(&mut **db) .await.unwrap_or(Some(0)).unwrap_or(0) { return None;