send code

This commit is contained in:
Administrator 2022-08-21 12:52:06 +03:00
parent cfa16d60d1
commit 261b0d34df
2 changed files with 5 additions and 1 deletions

View File

@ -23,7 +23,8 @@ class SendCodeView(BaseView):
print(f"Отправлен код для {username}", code)
user.userinfo.code = code
user.userinfo.save()
send_to_queue("telegram", {
send_to_queue("notification", {
"type": "send_code",
"chat_id": user.userinfo.telegram_chat_id,
"text": "Код для входа в сервис: " + str(code)
})

View File

@ -31,6 +31,9 @@ class Command(MessagingSupport):
parse_mode="html",
)
def handle_send_code(self, payload):
yield "telegram", payload
def handle_solution(self, payload):
solution = Solution.objects.get(id=payload["solution_id"])
user = solution.user