switch to macro for special user
Some checks failed
CI/CD Pipeline / test (push) Failing after 15m6s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-08-19 10:34:37 +02:00
parent c41dc0853a
commit 799e94a50f
13 changed files with 92 additions and 287 deletions

View File

@ -27,7 +27,7 @@ async fn index(
context.insert(
"loggedin_user",
&UserWithDetails::from_user(admin.0, db).await,
&UserWithDetails::from_user(admin.user, db).await,
);
context.insert("roles", &roles);

View File

@ -27,7 +27,7 @@ async fn index(
}
context.insert(
"loggedin_user",
&UserWithDetails::from_user(user.0, db).await,
&UserWithDetails::from_user(user.user, db).await,
);
let users: Vec<User> = User::all(db)

View File

@ -29,7 +29,7 @@ async fn index(
context.insert("schnupperanten", &users);
context.insert(
"loggedin_user",
&UserWithDetails::from_user(user.into(), db).await,
&UserWithDetails::from_user(user.user, db).await,
);
Template::render("admin/schnupper/index", context.into_json())

View File

@ -54,7 +54,7 @@ async fn index(
.map(|u| async move { UserWithRolesAndMembershipPdf::from_user(db, u).await })
.collect();
let user: User = user.into();
let user: User = user.into_inner();
let allowed_to_edit = user.has_role(db, "admin").await;
let users: Vec<UserWithRolesAndMembershipPdf> = join_all(user_futures).await;
@ -130,7 +130,7 @@ async fn fees(
}
context.insert(
"loggedin_user",
&UserWithDetails::from_user(admin.into(), db).await,
&UserWithDetails::from_user(admin.into_inner(), db).await,
);
Template::render("admin/user/fees", context.into_json())
@ -161,7 +161,7 @@ async fn scheckbuch(
}
context.insert(
"loggedin_user",
&UserWithDetails::from_user(user.into(), db).await,
&UserWithDetails::from_user(user.into_inner(), db).await,
);
Template::render("admin/user/scheckbuch", context.into_json())