def create_show_submission(): error = False try: show = Show() show.artist_id = request.form['artist_id'] show.venue_id = request.form['venue_id'] show.start_time = request.form['start_time'] db.session.add(show) db.session.commit() except: error = True db.session.rollback() print(sys.exc_info()) if error: flash('An error occurred.') else: flash(' show was successfully added') return render_template('pages/home.html')