Update Cargo dependencies #1152
@@ -1,6 +1,6 @@
 | 
				
			|||||||
use std::env;
 | 
					use std::env;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use chrono::Utc;
 | 
					use chrono::{Datelike, Utc};
 | 
				
			||||||
use rocket::{
 | 
					use rocket::{
 | 
				
			||||||
    form::Form,
 | 
					    form::Form,
 | 
				
			||||||
    fs::TempFile,
 | 
					    fs::TempFile,
 | 
				
			||||||
@@ -17,6 +17,7 @@ use sqlx::SqlitePool;
 | 
				
			|||||||
use tera::Context;
 | 
					use tera::Context;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use crate::model::{
 | 
					use crate::model::{
 | 
				
			||||||
 | 
					    activity::ActivityBuilder,
 | 
				
			||||||
    log::Log,
 | 
					    log::Log,
 | 
				
			||||||
    notification::Notification,
 | 
					    notification::Notification,
 | 
				
			||||||
    role::Role,
 | 
					    role::Role,
 | 
				
			||||||
@@ -179,7 +180,21 @@ async fn new_user(db: &State<SqlitePool>, data: Form<UserAdd>, user: User) -> Fl
 | 
				
			|||||||
    .await;
 | 
					    .await;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // add to `ergo`  group
 | 
					    // add to `ergo`  group
 | 
				
			||||||
    user.add_role(db, &ergo).await.unwrap();
 | 
					    sqlx::query!(
 | 
				
			||||||
 | 
					        "INSERT INTO user_role(user_id, role_id) VALUES (?, ?)",
 | 
				
			||||||
 | 
					        user.id,
 | 
				
			||||||
 | 
					        ergo.id
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    .execute(db.inner())
 | 
				
			||||||
 | 
					    .await
 | 
				
			||||||
 | 
					    .unwrap();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ActivityBuilder::new(&format!(
 | 
				
			||||||
 | 
					        "{user} nimmt an der Ergo-Challenge teil und hat gerade die Daten eingegeben."
 | 
				
			||||||
 | 
					    ))
 | 
				
			||||||
 | 
					    .user(&user)
 | 
				
			||||||
 | 
					    .save(db)
 | 
				
			||||||
 | 
					    .await;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Flash::success(
 | 
					    Flash::success(
 | 
				
			||||||
        Redirect::to("/ergo"),
 | 
					        Redirect::to("/ergo"),
 | 
				
			||||||
@@ -358,10 +373,7 @@ async fn new_dozen(
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub fn routes() -> Vec<Route> {
 | 
					pub fn routes() -> Vec<Route> {
 | 
				
			||||||
    routes![
 | 
					    routes![index, new_thirty, new_dozen, send, reset, update, new_user]
 | 
				
			||||||
        index, new_thirty, new_dozen, send, reset, update,
 | 
					 | 
				
			||||||
        // new_user
 | 
					 | 
				
			||||||
    ]
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[cfg(test)]
 | 
					#[cfg(test)]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user