From ef21e719c8b4d647703de41c273a336977183a5a Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 22 Apr 2024 10:36:47 +0200 Subject: [PATCH] allow to upload membership pdf for users which don't have it --- src/model/user.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/user.rs b/src/model/user.rs index 86e311a..eb796e5 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -977,8 +977,8 @@ pub struct UserWithRolesAndMembershipPdf { impl UserWithRolesAndMembershipPdf { pub(crate) async fn from_user(db: &SqlitePool, user: User) -> Self { let membership_pdf: bool = - sqlx::query_scalar!("SELECT membership_pdf FROM user WHERE id = $1", user.id) - .fetch_optional(db) + sqlx::query_scalar!("SELECT membership_pdf FROM user WHERE id = ?", user.id) + .fetch_one(db) .await .unwrap() .is_some(); -- 2.45.2