@@ -87,15 +87,11 @@ async def register_user(
8787 body = f"Benvenuto in Suppl-AI!\n Ecco la tua password temporanea\n \n { password } \n \n Accedi e cambiala subito!" ,
8888 )
8989 except Exception as e :
90- # raise HTTPException(
91- # status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
92- # detail=f"Failed to send email to user: {e}",
93- # )
94- print (f" Error: Failed to send to user the password: { e } " )
95- print (f" To: { user_data .email } " )
96- print (f" Subject: [Suppl-AI] Password Reset" )
97- print (f" Body: Ciao { user .get ('name' )} ,\n \n Ecco la tua nuova password temporanea:\n \n { password } \n \n Accedi e cambiala subito!" )
98- print (" Error: Failed to send email to user" )
90+ raise HTTPException (
91+ status_code = status .HTTP_500_INTERNAL_SERVER_ERROR ,
92+ detail = f"Failed to send email to user: { e } " ,
93+ )
94+ # print(f" Error: Failed to send to user the password: {e}")
9995
10096 return {"message" : "User registered successfully" , "password" : password }
10197
@@ -368,16 +364,13 @@ async def reset_password(
368364 subject = "[Suppl-AI] Password Reset" ,
369365 body = f"Ciao { user .get ('name' )} ,\n \n Ecco la tua nuova password temporanea:\n \n { password } \n \n Accedi e cambiala subito!" ,
370366 )
371- except Exception :
367+ except Exception as e :
372368 # raise HTTPException(
373369 # status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
374370 # detail=f"Failed to send email to user: {e}",
375371 # )
376372 print (" Error: Failed to send to user the password" )
377- print (f" To: { user_data .email } " )
378- print (f" Subject: [Suppl-AI] Password Reset" )
379- print (f" Body: Ciao { user .get ('name' )} ,\n \n Ecco la tua nuova password temporanea:\n \n { password } \n \n Accedi e cambiala subito!" )
380- print (" Error: Failed to send email to user" )
373+
381374 except Exception as e :
382375 raise HTTPException (
383376 status_code = status .HTTP_500_INTERNAL_SERVER_ERROR ,
0 commit comments