added code 303 where POST requests are redirected to endpoints that accept only GET (which, weirdly enough, never was a problem for werk and text)

This commit is contained in:
eclipse 2025-05-02 11:37:59 +02:00
parent b0e332f9d2
commit 6c24af2be4
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ def create():
db.session.add(Sprache(Sprache = request.form["form_Sprache"]))
db.session.commit()
flash("Eintrag erfolgreich hinzugefügt")
return redirect(url_for("sprache.all"))
return redirect(url_for("sprache.all"), code=303)
@bp.route("/sprache/update/<int:id>", methods=["POST"])
def update(id):
@ -27,7 +27,7 @@ def update(id):
sprache.Sprache = request.form["form_Sprache"]
db.session.commit()
flash("Eintrag erfolgreich geändert")
return redirect(url_for("sprache.all"))
return redirect(url_for("sprache.all"), code=303)
@bp.route("/sprache/delete/<int:id>")
def delete(id):

View File

@ -19,7 +19,7 @@ def create():
db.session.add(Verlag(Verlag = request.form["form_Verlag"]))
db.session.commit()
flash("Eintrag erfolgreich hinzugefügt")
return redirect(url_for("verlag.all"))
return redirect(url_for("verlag.all"), code=303)
@bp.route("/verlag/update/<int:id>", methods=["POST"])
def update(id):
@ -27,7 +27,7 @@ def update(id):
verlag.Verlag = request.form["form_Verlag"]
db.session.commit()
flash("Eintrag erfolgreich geändert")
return redirect(url_for("verlag.all"))
return redirect(url_for("verlag.all"), code=303)
@bp.route("/verlag/delete/<int:id>")
def delete(id):