use an integer field for length

stable
neingeist 6 years ago
parent a5bb4fe894
commit 2f9fbf95fb

@ -2,7 +2,7 @@ from flask import (Flask, render_template, flash, redirect,
url_for, request, send_from_directory)
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from wtforms import DateTimeField, DecimalField, SubmitField
from wtforms import DateTimeField, IntegerField, SubmitField
from wtforms.validators import DataRequired, NumberRange
from datetime import datetime, timedelta
@ -21,7 +21,7 @@ Bootstrap(app)
class DownloadForm(FlaskForm):
start_time = DateTimeField('Start time', validators=[DataRequired()], id='start_time')
length = DecimalField('Length', validators=[DataRequired(),
length = IntegerField('Length', validators=[DataRequired(),
NumberRange(min=1, max=app.config['MAX_LENGTH'])])
submit = SubmitField('Download')

Loading…
Cancel
Save