From f1161c65fb67c2f54a7c20b0f7aafdc2f9cd0af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Tue, 8 Jan 2019 14:05:05 +0100 Subject: [PATCH] Make sure an invitation is created when reinviting --- src/api/core/organizations.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index daa4faa6..38bb6021 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -545,8 +545,9 @@ fn reinvite_user(org_id: String, user_org: String, headers: AdminHeaders, conn: Some(user) => user, None => err!("User not found."), }; - - Invitation::take(&user.email, &conn); + + let mut invitation = Invitation::new(user.email.clone()); + invitation.save(&conn)?; let org_name = match Organization::find_by_uuid(&org_id, &conn) { Some(org) => org.name,