Compare commits
No commits in common. "79976b751fb510504f4ac5b350a4795c06143d93" and "ebdfe37bec8296f545c97feac39baf4749f44243" have entirely different histories.
79976b751f
...
ebdfe37bec
@ -989,16 +989,12 @@ 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 =
|
let membership_pdf: bool =
|
||||||
match sqlx::query_scalar!("SELECT membership_pdf FROM user WHERE id = ?", user.id)
|
sqlx::query_scalar!("SELECT membership_pdf FROM user WHERE id = ?", user.id)
|
||||||
.fetch_one(db)
|
.fetch_one(db)
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
{
|
.is_some();
|
||||||
Some(a) if a.is_empty() => false,
|
|
||||||
None => false,
|
|
||||||
_ => true,
|
|
||||||
};
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
roles: user.roles(db).await,
|
roles: user.roles(db).await,
|
||||||
|
Loading…
Reference in New Issue
Block a user