Commit e90991e2 authored by Timothy Gillespie's avatar Timothy Gillespie

Add small missing code fragments

parent 23ff0483
......@@ -4,6 +4,7 @@ from cryptography.fernet import Fernet
from markupsafe import escape
import requests
import telegram_notificator
import os
key = Fernet.generate_key()
f = Fernet(key)
......@@ -40,6 +41,10 @@ def get_chat_id(code):
@app.route("/bot/" + telegram_api_key + "/", methods=["POST"])
def send_link():
data = request.get_json()
if data is None:
abort(404)
message = data.get("message", None)
if message is None:
return "Ok!"
......@@ -60,7 +65,7 @@ def send_link():
url = application_website + "/" + token + "/"
telegram = telegram_notificator.TelegramNotificator(telegram_api_key, str(chat_id))
telegram.send()
telegram.send(url)
return "Ok!"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment