diff --git a/src/tera/ergo.rs b/src/tera/ergo.rs index e0fb3b1..8b00446 100644 --- a/src/tera/ergo.rs +++ b/src/tera/ergo.rs @@ -1,5 +1,6 @@ use std::env; +use chrono::Utc; use rocket::{ form::Form, fs::TempFile, @@ -148,7 +149,11 @@ async fn new_thirty( return Flash::error(Redirect::to("/ergo"), "Es werden nur JPG Bilder akzeptiert"); }; let base_dir = env::current_dir().unwrap(); - let file_path = base_dir.join(format!("data-ergo/thirty/{}.{extension}", user.name)); + let file_path = base_dir.join(format!( + "data-ergo/thirty/{}_{}.{extension}", + user.name, + Utc::now() + )); if let Err(e) = data.proof.move_copy_to(file_path).await { eprintln!("Failed to persist file: {:?}", e); } @@ -185,7 +190,11 @@ async fn new_dozen( return Flash::error(Redirect::to("/ergo"), "Es werden nur JPG Bilder akzeptiert"); }; let base_dir = env::current_dir().unwrap(); - let file_path = base_dir.join(format!("data-ergo/dozen/{}.{extension}", user.name)); + let file_path = base_dir.join(format!( + "data-ergo/dozen/{}_{}.{extension}", + user.name, + Utc::now() + )); if let Err(e) = data.proof.move_copy_to(file_path).await { eprintln!("Failed to persist file: {:?}", e); }