# -*- coding: UTF-8 -*-
from django.shortcuts import redirect
from django.shortcuts import render

from forms import InspirationQuoteForm


def add_quote(request):
    if request.method == "POST":
        form = InspirationQuoteForm(data=request.POST, files=request.FILES)
        if form.is_valid():
            quote = form.save()
            return redirect("add_quote_done")
    else:
        form = InspirationQuoteForm()
    return render(request, "quotes/change_quote.html", {'form': form})
