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')