add retrival of last ticket
This commit is contained in:
parent
e794fc6032
commit
be7dcf5903
@ -3,10 +3,20 @@ from freeriders import app, db
|
||||
from freeriders.models import Ticket
|
||||
import time
|
||||
|
||||
@app.route('/', methods=['POST', 'GET'])
|
||||
def changepassword():
|
||||
@app.route('/sms', methods=['GET'])
|
||||
def sms():
|
||||
if request.method == 'GET':
|
||||
return render_template('index.html')
|
||||
try:
|
||||
lastticket = Ticket.query.order_by(Ticket.timestamp.desc()).first()
|
||||
return render_template('sms.html', ticket = lastticket)
|
||||
except:
|
||||
return 'Error retriving last ticket'
|
||||
else:
|
||||
return 'HTTP request method not recogniezed'
|
||||
@app.route('/submit', methods=['POST', 'GET'])
|
||||
def submit():
|
||||
if request.method == 'GET':
|
||||
return render_template('submit.html')
|
||||
elif request.method == 'POST':
|
||||
timenow = int(time.time())
|
||||
ticket_input = request.form['ticket']
|
||||
|
Loading…
Reference in New Issue
Block a user