0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-04-01 02:42:49 -05:00

Adjust deleting records

Signed-off-by: BlackDex <black.dex@gmail.com>
This commit is contained in:
BlackDex 2025-01-07 11:45:00 +01:00
parent 391d3fe87c
commit f4130f7d6a
No known key found for this signature in database
GPG key ID: 58C80A2AA6C765E1
2 changed files with 4 additions and 4 deletions

View file

@ -954,10 +954,10 @@ async fn send_invite(org_id: &str, data: Json<InviteData>, headers: AdminHeaders
{
// Upon error delete the user, invite and org member records when needed
if user_created {
Invitation::take(email, &mut conn).await;
user.delete(&mut conn).await?;
} else {
new_member.delete(&mut conn).await?;
}
new_member.delete(&mut conn).await?;
err!(format!("Error sending invite: {e:?} "));
};

View file

@ -135,10 +135,10 @@ async fn ldap_import(data: Json<OrgImportData>, token: PublicToken, mut conn: Db
{
// Upon error delete the user, invite and org member records when needed
if user_created {
Invitation::take(&user_data.email.clone(), &mut conn).await;
user.delete(&mut conn).await?;
} else {
new_member.delete(&mut conn).await?;
}
new_member.delete(&mut conn).await?;
err!(format!("Error sending invite: {e:?} "));
}