diff --git a/app.py b/app.py index 6255df0..4067ba5 100644 --- a/app.py +++ b/app.py @@ -21,46 +21,33 @@ class UploadForm(FlaskForm): metadata = FileField( validators=[FileAllowed(["db"], "Metadata databases only"), FileRequired()] ) - - -class CardSidesForm(FlaskForm): title = RadioField("title", choices=[("side a", "side a"), ("side b", "side b")]) @app.route("/") def home(): upload_form = UploadForm() - card_sides_form = CardSidesForm() - return render_template( - "index.html", upload_form=upload_form, card_sides_form=card_sides_form - ) + return render_template("index.html", upload_form=upload_form) @app.route("/upload", methods=["POST"]) def upload(): upload_form = UploadForm() - card_sides_form = CardSidesForm() if upload_form.validate_on_submit(): f = upload_form.metadata.data filename = secure_filename(f.filename) f.save(os.path.join(CWD, "metadatum", filename)) return redirect(url_for("home")) - return render_template( - "index.html", upload_form=upload_form, card_sides_form=card_sides_form - ) + return render_template("index.html", upload_form=upload_form) @app.route("/generate", methods=["POST"]) def generate(): upload_form = UploadForm() - card_sides_form = CardSidesForm() - - if card_sides_form.validate_on_submit(): - print(card_sides_form.title.data) + if upload_form.validate_on_submit(): + print(upload_form.title.data) else: print("didnt work") - return render_template( - "index.html", upload_form=upload_form, card_sides_form=card_sides_form - ) + return render_template("index.html", upload_form=upload_form) diff --git a/templates/index.html b/templates/index.html index b6652aa..36a9d56 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,7 +7,11 @@
- {{ upload_form.csrf_token }} {{ upload_form.metadata }} + {{ upload_form.csrf_token }} + + {{ upload_form.metadata }} + + {{ upload_form.title }}
@@ -19,9 +23,6 @@ {% endif %} -
- {{ card_sides_form.csrf_token }} {{ card_sides_form.title }} -