forked from zdzichu/quick-qrcode-generator
docs(qrgen): mention problems with default & retained checkbox state
This commit is contained in:
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user