Skip to content

Commit

Permalink
Merge pull request #5360 from mozilla/mntor-3843
Browse files Browse the repository at this point in the history
Make QA customs tool usable after account recreation
  • Loading branch information
flozia authored Dec 3, 2024
2 parents 7f6074f + 5f2410c commit 05ecc72
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/db/tables/qa_customs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,15 @@ async function createQaTogglesRow(
const existingRow = await knex("qa_custom_toggles")
.where({ email_hash: emailHash })
.first();

// If an account was deleted and recreated, it has another
// `onerep_profile_id`. Let’s make sure to update it!
if (existingRow && existingRow.onerep_profile_id !== onerep_profile_id) {
await knex("qa_custom_toggles").where({ email_hash: emailHash }).update({
onerep_profile_id,
});
}

return existingRow as QaToggleRow;
}
}
Expand Down

0 comments on commit 05ecc72

Please sign in to comment.