def display_score(): if session.get('score') != None: current_user.total_score += session.get('score') current_user.update_user_info() score = session.pop('score') History.find_and_update(userID=current_user._id, score=score) return render_template('final_score.html', score=score) else: flash('You haven\'t played the Quiz yet!') return redirect('/')