Ejemplo n.º 1
0
def user_preferences(request):
    form = UserPreferencesForm(request.POST or None, request.FILES or None, instance=request.user)

    if request.method == "POST":
        if form.is_valid():
            form.save()
            messages.success(request, 'Your preferences have been updated successfully!')

    return render(request, 'user_preferences.html', dict(form=form, bot_name=bot_name))
Ejemplo n.º 2
0
def user_preferences():
    form = UserPreferencesForm()
    questions = Question.query.filter_by(type='Basic').all()
    #TODO- Test preferences and finish UserPreferencesForm validation
    return render_template('user_preferences.html',
                           form=form,
                           title='Preferences')