feat(qrgen): deny empty string; fix Submit button
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
from flask import Flask, render_template, flash, request
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import Form, TextField, BooleanField
|
||||
from wtforms import Form, BooleanField, SubmitField, TextField
|
||||
from wtforms.validators import DataRequired
|
||||
import os
|
||||
|
||||
DEBUG = False
|
||||
@@ -11,8 +12,9 @@ app.config.from_object(__name__)
|
||||
app.config['SECRET_KEY'] = os.urandom(40)
|
||||
|
||||
class QRForm(FlaskForm):
|
||||
user_data = TextField("Dane:")
|
||||
user_data = TextField("Dane:", validators=[DataRequired()])
|
||||
trim_spaces = BooleanField("Usuń spacje", default=True)
|
||||
submit = SubmitField("Generuj")
|
||||
|
||||
@app.route("/", methods=["GET", "POST"])
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user