From 2e121143503d0d010db7081f258e7db227ded8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Fri, 12 Apr 2019 23:42:42 +0200 Subject: [PATCH] Always create the user when inviting from admin panel --- src/api/admin.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/admin.rs b/src/api/admin.rs index 09f1882..a38b560 100644 --- a/src/api/admin.rs +++ b/src/api/admin.rs @@ -145,9 +145,10 @@ fn invite_user(data: Json, _token: AdminToken, conn: DbConn) -> Empt err!("Invitations are not allowed") } + let mut user = User::new(email); + user.save(&conn)?; + if CONFIG.mail_enabled() { - let mut user = User::new(email); - user.save(&conn)?; let org_name = "bitwarden_rs"; mail::send_invite(&user.email, &user.uuid, None, None, &org_name, None) } else {