Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def index(request):
- if request.method == "POST":
- form = ExchangeForm(request.POST)
- if form.is_valid():
- genre = None
- for code, name in GENRE_CHOICES:
- if code == form.cleaned_data["genre"]:
- genre = name
- break
- send_msg(
- form.cleaned_data["email"],
- form.cleaned_data["name"],
- form.cleaned_data["title"],
- form.cleaned_data["artist"],
- genre,
- form.cleaned_data["price"],
- form.cleaned_data["comment"],
- )
- return redirect('/thank-you/')
- return render(request, "index.html", {"form": form})
- form = ExchangeForm()
- return render(request, "index.html", {"form": form})
Add Comment
Please, Sign In to add comment