From fe3d283e3c2399549db881af20ac1e0e54930f0f Mon Sep 17 00:00:00 2001 From: urec56 Date: Tue, 27 Aug 2024 19:11:18 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=20=D0=BA=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/user_service.py | 2 + app/tasks/email_templates.py | 129 ++++++++++++++++++----------------- 2 files changed, 70 insertions(+), 61 deletions(-) diff --git a/app/services/user_service.py b/app/services/user_service.py index 299e5c1..0e8b426 100644 --- a/app/services/user_service.py +++ b/app/services/user_service.py @@ -1,3 +1,4 @@ +import logging from datetime import timedelta from pydantic import ValidationError @@ -75,6 +76,7 @@ class UserService: verification_code = await redis.get_value(key=f"user_verification_code: {user.id}") except AttributeError: raise WrongCodeException + logging.warning(verification_code) if verification_code != confirmation_code: raise WrongCodeException async with uow: diff --git a/app/tasks/email_templates.py b/app/tasks/email_templates.py index 6b5b74d..bd8c57f 100644 --- a/app/tasks/email_templates.py +++ b/app/tasks/email_templates.py @@ -16,80 +16,87 @@ def create_registration_confirmation_template( email.set_content( f""" - - - + + Submiting - - - + + + + + + + + + + + + + + + + +
 
 
+
- -
- -

Код подтверждения, {username}

-
+ border-radius: 12px; -

{confirmation_code}

-
+ font-family: comfortaa; + "> -

или

+

Код подтверждения для сладкого {username}

- +

перейдите по ссылке

-
-
+ font-family: comfortaa; + ">{confirmation_code} + +

или

+ + перейдите по ссылке + +
 
 
- - + """, subtype="html", ) @@ -165,7 +172,7 @@ def create_data_change_confirmation_email(username: str, email_to: EmailStr, _: - """, + """, subtype="html", ) return email @@ -230,7 +237,7 @@ def create_data_change_email(username: str, email_to: EmailStr): - """, + """, subtype="html", ) return email