From c3dcccb479978f9dc55efc36b0efd549be84c50c Mon Sep 17 00:00:00 2001 From: raphael Date: Sat, 25 Jul 2020 23:44:49 +0200 Subject: [PATCH] reloads page after successful form transmition in routes --- server/routes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/routes.py b/server/routes.py index f589100..768c409 100644 --- a/server/routes.py +++ b/server/routes.py @@ -109,10 +109,13 @@ def calendar(): calendar = db.session.query(Calendar).filter(Calendar.calendar_id==request.form.get("calendar")).first() db.session.delete(calendar) db.session.commit() + return flask.redirect(url_for('calendar')) elif form.validate_on_submit(): ical.icalToCalendarDb(form.iCalURL.data, form.calName.data, current_user) + return flask.redirect(url_for('calendar')) + # otherwise it is a javascript POST else: try: @@ -140,7 +143,6 @@ def calendar(): current_user.updateCalendar(calId, toggle=toggle) # toggle specific calendar of user - return 'OK' return flask.render_template('calendar.html', calendars=calendars, form=form)