fix wording and spacing

This commit is contained in:
fram3d 2023-10-03 21:25:52 +02:00
parent be7dcf5903
commit 62833a2bd6
Signed by: fram3d
GPG Key ID: 938920E709EEA32A

View File

@ -13,6 +13,7 @@ def sms():
return 'Error retriving last ticket' return 'Error retriving last ticket'
else: else:
return 'HTTP request method not recogniezed' return 'HTTP request method not recogniezed'
@app.route('/submit', methods=['POST', 'GET']) @app.route('/submit', methods=['POST', 'GET'])
def submit(): def submit():
if request.method == 'GET': if request.method == 'GET':
@ -20,14 +21,14 @@ def submit():
elif request.method == 'POST': elif request.method == 'POST':
timenow = int(time.time()) timenow = int(time.time())
ticket_input = request.form['ticket'] ticket_input = request.form['ticket']
ticket = Ticket(ticket=ticket_input, timestamp=timenow) ticket = Ticket(ticket = ticket_input, timestamp = timenow)
try: try:
db.session.add(ticket) db.session.add(ticket)
db.session.commit() db.session.commit()
return 'Ticket je dodat' return 'Ticket added'
except: except:
return 'Dodavanje ticketa nije uspelo' return 'Adding ticket failed'
else: else:
return 'HTTP request method not recogniezed' return 'HTTP request method not recogniezed'