From 1022a44f12f66aba622f53dba5d15274435e3e4a Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 4 May 2026 19:51:49 +0200 Subject: [PATCH] Fix GH Issue #65 --- tienda/tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tienda/tasks.py b/tienda/tasks.py index a547100..f111d5b 100644 --- a/tienda/tasks.py +++ b/tienda/tasks.py @@ -33,7 +33,11 @@ def enviar_correo_confirmacion(id: int): @shared_task def enviar_correo_recuperacion(email: str): - usuario = User.objects.get(email=email) + usuario: User | None + try: + usuario = User.objects.get(email=email) + except User.DoesNotExist as e: + print("ERROR: User does not exist, Cancelling task!") if usuario is not None: ver_code = VerificationCode.objects.create( code_mode = VerificationCode.VerificationModes.RESET_PASSWORD, @@ -53,6 +57,7 @@ def enviar_correo_recuperacion(email: str): ) send_hemail(email, "Reset de ContraseƱa", html_content, "Estas reseteando la contraseƱa...") + else: # Purchased items should be a list of dictionary, the dictionary must follow this tags: amount, product name, price (each)