send code
This commit is contained in:
parent
cfa16d60d1
commit
261b0d34df
@ -23,7 +23,8 @@ class SendCodeView(BaseView):
|
|||||||
print(f"Отправлен код для {username}", code)
|
print(f"Отправлен код для {username}", code)
|
||||||
user.userinfo.code = code
|
user.userinfo.code = code
|
||||||
user.userinfo.save()
|
user.userinfo.save()
|
||||||
send_to_queue("telegram", {
|
send_to_queue("notification", {
|
||||||
|
"type": "send_code",
|
||||||
"chat_id": user.userinfo.telegram_chat_id,
|
"chat_id": user.userinfo.telegram_chat_id,
|
||||||
"text": "Код для входа в сервис: " + str(code)
|
"text": "Код для входа в сервис: " + str(code)
|
||||||
})
|
})
|
||||||
|
@ -31,6 +31,9 @@ class Command(MessagingSupport):
|
|||||||
parse_mode="html",
|
parse_mode="html",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def handle_send_code(self, payload):
|
||||||
|
yield "telegram", payload
|
||||||
|
|
||||||
def handle_solution(self, payload):
|
def handle_solution(self, payload):
|
||||||
solution = Solution.objects.get(id=payload["solution_id"])
|
solution = Solution.objects.get(id=payload["solution_id"])
|
||||||
user = solution.user
|
user = solution.user
|
||||||
|
Loading…
Reference in New Issue
Block a user