From 2f9fbf95fbaa06fdb2f8eba14217d8c323c8ff4c Mon Sep 17 00:00:00 2001 From: neingeist Date: Mon, 12 Nov 2018 00:06:36 +0100 Subject: [PATCH] use an integer field for length --- prolefeeder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prolefeeder.py b/prolefeeder.py index 72aa5fb..6b09cfc 100644 --- a/prolefeeder.py +++ b/prolefeeder.py @@ -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')