Merge pull request 'allow to upload membership pdf for users which don't have it' (#415) from allow-membership-uploads into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m35s
CI/CD Pipeline / deploy-staging (push) Successful in 7m26s
CI/CD Pipeline / deploy-main (push) Has been skipped

Reviewed-on: #415
This commit is contained in:
philipp 2024-04-22 10:37:09 +02:00
commit 3c67e0deeb

View File

@ -990,8 +990,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();