Skip to content

Commit

Permalink
Adjust deleting records
Browse files Browse the repository at this point in the history
Signed-off-by: BlackDex <[email protected]>
  • Loading branch information
BlackDex committed Jan 7, 2025
1 parent d0a49b9 commit 6056005
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/core/organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?} "));
};
Expand Down
4 changes: 2 additions & 2 deletions src/api/core/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?} "));
}
Expand Down

0 comments on commit 6056005

Please sign in to comment.