allow to upload membership pdf for users which don't have it
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
philipp 2024-04-22 10:36:47 +02:00
parent 254e8b7063
commit ef21e719c8

View File

@ -977,8 +977,8 @@ pub struct UserWithRolesAndMembershipPdf {
impl UserWithRolesAndMembershipPdf { impl UserWithRolesAndMembershipPdf {
pub(crate) async fn from_user(db: &SqlitePool, user: User) -> Self { pub(crate) async fn from_user(db: &SqlitePool, user: User) -> Self {
let membership_pdf: bool = let membership_pdf: bool =
sqlx::query_scalar!("SELECT membership_pdf FROM user WHERE id = $1", user.id) sqlx::query_scalar!("SELECT membership_pdf FROM user WHERE id = ?", user.id)
.fetch_optional(db) .fetch_one(db)
.await .await
.unwrap() .unwrap()
.is_some(); .is_some();