Skip to content

Conversation

@jacobpenny
Copy link

No description provided.

lang = user_data.get("lang", "en") or "en"
email_id = user_data.get("email_id")
tasks.send_recovery_message.delay(email, user_data["token"], lang, email_id)
tasks.send_recovery_message.delay(email, email_id, lang, email_id)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you just remove the token param here so you don't need to pass email_id twice?


# These tasks cannot be placed in basket/news/tasks.py because it would
# This task cannot be placed in basket/news/tasks.py because it would
# create a circular dependency.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to leave this comment here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because there is still one task (the alias one)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's worth removing the empty space between that comment and that task then? So it's clear that's what it's about

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes, indeed

txm = BrazeTxEmailMessage.objects.get_message(message_id, lang)
if txm:
user_data = {"basket_token": token, "email_id": email_id}
user_data = {"basket_token": email_id, "email_id": email_id}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but send_confirm_message is using the "token" param and send_recovery_message is using the "email_id" param -- you might want to make them consistent with each other instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! good catch

expected = {
"attributes": [
{
"_update_existing_only": False,
Copy link

@clara-campos clara-campos Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete this test (test_to_vendor_with_updates_and_no_user_data_in_braze_only_write) -- we no longer have that conditional external id based on braze_only_write

@param token: basket_token
@param email: email address
@param fxa_id: external ID from FxA
@return: dict, or None if not found
Copy link

@clara-campos clara-campos Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're not using the email_id param in braze.get, we should probably get rid of it to avoid even more confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants