diff --git a/src/api/admin.rs b/src/api/admin.rs index 9eb965cc86..200a58f182 100644 --- a/src/api/admin.rs +++ b/src/api/admin.rs @@ -279,12 +279,11 @@ async fn get_user_or_404(uuid: &str, conn: &mut DbConn) -> ApiResult { #[post("/invite", data = "")] async fn invite_user(data: Json, _token: AdminToken, mut conn: DbConn) -> JsonResult { let data: InviteData = data.into_inner(); - let email = data.email.clone(); if User::find_by_mail(&data.email, &mut conn).await.is_some() { err_code!("User already exists", Status::Conflict.code) } - let mut user = User::new(email); + let mut user = User::new(data.email); async fn _generate_invite(user: &User, conn: &mut DbConn) -> EmptyResult { if CONFIG.mail_enabled() {