From b1af1375578e41a240a4eedff73209e212a31051 Mon Sep 17 00:00:00 2001 From: stuppie Date: Tue, 22 Sep 2026 15:56:14 -0600 Subject: create_paypal_cashout_method upon user login. fix nginx for docs --- jb/views/auth.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'jb/views/auth.py') diff --git a/jb/views/auth.py b/jb/views/auth.py index cc1224f..36b013f 100644 --- a/jb/views/auth.py +++ b/jb/views/auth.py @@ -26,6 +26,10 @@ from jb.managers.email_manager import ( send_login_email, ) from jb.managers.gr_api import GRApiManager +from jb.managers.thl import ( + create_paypal_cashout_method_if_not_exists, + create_paypal_cashout_method, +) from jb.models.auth import ( AccountLogin, AmtAccountLink, @@ -112,6 +116,14 @@ def exchange_magic_link( def _exchange_magic_link(token: str, response: Response, gr_api: GRApiManager) -> None: user_email = consume_magic_token(token) user = gr_api.ensure_user_exists(User.model_validate({"email": user_email})) + + # create_paypal_cashout_method_if_not_exists( + # product_user_id=user.product_user_id, email=user.email + # ) + create_paypal_cashout_method( + product_user_id=user.product_user_id, email=user.email + ) + response.set_cookie( key=SESSION_COOKIE_NAME, value=create_session(user.product_user_id), @@ -210,6 +222,8 @@ def _exchange_amt_account_link(token: str, response: Response, gr_api: GRApiMana user = User(email=email) user = gr_api.transition_user_from_amt(user=user, amt_worker_id=amt_worker_id) + # create_paypal_cashout_method_if_not_exists(product_user_id=user.product_user_id, email=user.email) + create_paypal_cashout_method(product_user_id=user.product_user_id, email=user.email) # In Mautic, associate the email with the worker ID (AFTER the user has transitioned) get_or_create_contact(email=email, amt_worker_id=amt_worker_id) -- cgit v1.2.3