This commit is contained in:
Administrator 2022-10-14 06:02:12 +03:00
parent 9e58091a04
commit 2611e06daa

View File

@ -12,6 +12,8 @@ class Command(MessagingSupport):
queue_name = "notification" queue_name = "notification"
def send_email(self, payload): def send_email(self, payload):
"""С email потом разберемся"""
return
subject = payload['subject'] subject = payload['subject']
message = payload['message'] message = payload['message']
email = payload['email'] email = payload['email']
@ -54,8 +56,8 @@ class Command(MessagingSupport):
message = f"Пользователь {from_user.username} хочет добавить тебя в друзья" message = f"Пользователь {from_user.username} хочет добавить тебя в друзья"
if user.userinfo.notification_telegram: if user.userinfo.notification_telegram:
yield "telegram", {"chat_id": user.userinfo.telegram_chat_id, "text": message} yield "telegram", {"chat_id": user.userinfo.telegram_chat_id, "text": message}
# if user.userinfo.notification_email: if user.userinfo.notification_email:
# yield "email", {"subject": "Новая заявка в друзья", "message": message, "email": user.email} yield "email", {"subject": "Новая заявка в друзья", "message": message, "email": user.email}
def handle_friends_accept(self, payload): def handle_friends_accept(self, payload):
user = User.objects.get(id=payload['to_user']) user = User.objects.get(id=payload['to_user'])