also show button again
All checks were successful
CI/CD Pipeline / test (push) Successful in 19m25s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
Philipp Hofer
2025-10-07 16:04:44 +02:00
parent 6e418b6f2f
commit ebce600356
4 changed files with 17 additions and 12 deletions

View File

@@ -2,7 +2,6 @@ use std::env;
use chrono::Utc;
use rocket::{
FromForm, Route, State,
form::Form,
fs::TempFile,
get,
@@ -10,9 +9,9 @@ use rocket::{
post,
request::FlashMessage,
response::{Flash, Redirect},
routes,
routes, FromForm, Route, State,
};
use rocket_dyn_templates::{Template, context};
use rocket_dyn_templates::{context, Template};
use serde::Serialize;
use sqlx::SqlitePool;
use tera::Context;
@@ -21,7 +20,7 @@ use crate::model::{
log::Log,
notification::Notification,
role::Role,
user::{AdminUser, User, UserWithDetails},
user::{AdminUser, ErgoAdminUser, User, UserWithDetails},
};
#[derive(Serialize)]
@@ -59,7 +58,7 @@ async fn send(db: &State<SqlitePool>, _user: AdminUser) -> Template {
}
#[get("/reset")]
async fn reset(db: &State<SqlitePool>, _user: AdminUser) -> Flash<Redirect> {
async fn reset(db: &State<SqlitePool>, _user: ErgoAdminUser) -> Flash<Redirect> {
sqlx::query!("UPDATE user SET dirty_thirty = NULL, dirty_dozen = NULL;")
.execute(db.inner())
.await
@@ -74,7 +73,7 @@ async fn reset(db: &State<SqlitePool>, _user: AdminUser) -> Flash<Redirect> {
#[get("/<challenge>/user/<user_id>/new?<new>")]
async fn update(
db: &State<SqlitePool>,
_admin: AdminUser,
_admin: ErgoAdminUser,
challenge: &str,
user_id: i64,
new: &str,

View File

@@ -65,7 +65,7 @@ async fn index(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage<'_
let date = chrono::Utc::now();
if date.month() <= 3 || date.month() >= 10 {
// context.insert("show_quick_ergo_button", "yes");
context.insert("show_quick_ergo_button", "yes");
}
context.insert("achievements", &Achievements::for_user(db, &user).await);