netclock/countdown/views.py

21 lines
746 B
Python
Raw Normal View History

2020-09-12 10:58:38 +00:00
from flask import render_template, request, flash, redirect, url_for
2020-09-12 17:51:47 +00:00
from . import app
from . import forms
2020-09-12 10:58:38 +00:00
2020-09-12 17:51:47 +00:00
@app.route('/<uuid:countdown_id>', methods=['GET'])
def countdown(countdown_id):
return render_template('countdown/countdown.html', countdown_id=countdown_id)
2020-09-12 10:58:38 +00:00
@app.route('/', methods=['GET', 'POST', 'PUT'])
def countdown_admin():
2020-09-12 17:51:47 +00:00
form = forms.CountdownAdminForm(request.form)
2020-09-12 10:58:38 +00:00
if request.method == 'POST' and form.validate():
2020-09-12 17:51:47 +00:00
# user = User(form.username.data, form.email.data,
# form.password.data)
# db_session.add(user)
2020-09-12 10:58:38 +00:00
flash('Thanks for registering')
return redirect(url_for('login'))
2020-09-12 17:51:47 +00:00
return render_template('countdown/countdown_admin.html', form=form, clock=None)