from django.http import HttpResponseRedirect
from django.shortcuts import render

from .forms import FeedbackForm


def get_name(request):
    if request.method == "POST":
        form = FeedbackForm(request.POST)
        if form.is_valid():
            return HttpResponseRedirect("/thanks/")
    else:
        form = FeedbackForm()

    return render(request, "feedback/name.html", {"form": form})
