diff --git a/app/qrwebform.py b/app/qrwebform.py index d48806b..d7bebd6 100755 --- a/app/qrwebform.py +++ b/app/qrwebform.py @@ -13,7 +13,11 @@ app.config['SECRET_KEY'] = os.urandom(40) class QRForm(FlaskForm): user_data = TextField("Dane:", validators=[DataRequired()]) - trim_spaces = BooleanField("Usuń spacje", default=True) + # setting default here doesn't work, so we cannot retain checkbox state over POST + # we force trim_spaced to be checked in the template + # see https://github.com/wtforms/flask-wtf/issues/489 https://github.com/wtforms/flask-wtf/issues/362 + # https://github.com/wtforms/flask-wtf/issues/464 + trim_spaces = BooleanField("Usuń spacje") submit = SubmitField("Generuj") @app.route("/", methods=["GET", "POST"])