def add_customer_preference(userid): form = PreferenceForm(request.form) user = userid_to_object(userid) if request.method == 'POST' and form.validate(): insert_preference(userid, form.preference.data) preferences = get_preferences(userid) return render_template('/customerreptasks/preferences.html', form=form, preferences=preferences, user=user)
def preferences(): form = PreferenceForm(request.form) if request.method == 'POST' and form.validate(): insert_preference(session['userid'], form.preference.data) preferences = get_preferences(session['userid']) return render_template('/usertasks/preferences.html', form=form, preferences=preferences)