allow to upload membership pdf for users which don't have it #416
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user