diff --git a/src/controllers/users_controller.rs b/src/controllers/users_controller.rs index e9886c0..cf50280 100644 --- a/src/controllers/users_controller.rs +++ b/src/controllers/users_controller.rs @@ -307,8 +307,6 @@ pub async fn set_approved<'r>( pub async fn reject<'r>( username: String, _session: AdminSession, - mailer: &'r State, - conf: &'r State, db: DbConn, ) -> Result> { let user = User::find_by_username(username, &db).await?; @@ -319,20 +317,6 @@ pub async fn reject<'r>( ))); } - mailer - .create( - &user, - String::from("[Zauth] Your account has been rejected"), - template!( - "mails/user_rejected.txt"; - name: String = user.full_name.to_string(), - admin_email: String = conf.admin_email.clone() - ) - .render() - .map_err(InternalError::from)?, - ) - .await?; - user.delete(&db).await?; Ok(Accepter { diff --git a/templates/mails/user_rejected.txt b/templates/mails/user_rejected.txt deleted file mode 100644 index 9f8bf42..0000000 --- a/templates/mails/user_rejected.txt +++ /dev/null @@ -1,7 +0,0 @@ -Hi {{name}} - -Your registration request for a Zeus account has been rejected. -If you think this is a mistake you can contact us at {{admin_email}}. - -Kind regards -The Zeus Authentication Server diff --git a/tests/users.rs b/tests/users.rs index c88eaec..0a837cd 100644 --- a/tests/users.rs +++ b/tests/users.rs @@ -844,17 +844,14 @@ async fn user_rejectal_flow() { "after email is confirmed, user should be pending for approval" ); - common::expect_mail_to(vec![&email], async || { - let response = http_client - .post(format!("/users/{}/reject/", user.username)) - .header(Accept::HTML) - .header(ContentType::Form) - .dispatch() - .await; + let response = http_client + .post(format!("/users/{}/reject/", user.username)) + .header(Accept::HTML) + .header(ContentType::Form) + .dispatch() + .await; - assert_eq!(response.status(), Status::SeeOther); - }) - .await; + assert_eq!(response.status(), Status::SeeOther); user.reload(&db).await.expect_err("user should be removed"); })