2016-12-19 07:20:48 +00:00
|
|
|
from django.shortcuts import redirect
|
|
|
|
from django.views.generic import TemplateView
|
2016-12-19 05:15:06 +00:00
|
|
|
from django.views.generic.edit import FormView
|
|
|
|
|
|
|
|
from .forms import TicketForm
|
|
|
|
from .models import Ticket
|
|
|
|
|
|
|
|
class TicketView(FormView):
|
|
|
|
form_class = TicketForm
|
|
|
|
template_name = 'help/tickets.html'
|
|
|
|
|
|
|
|
def form_valid(self, form):
|
2016-12-19 07:20:48 +00:00
|
|
|
del form.cleaned_data['captcha']
|
|
|
|
t = Ticket.objects.create(**form.cleaned_data)
|
|
|
|
return redirect('help:ticket_submitted')
|
|
|
|
|
|
|
|
class TicketSubmittedView(TemplateView):
|
|
|
|
template_name = 'help/ticket_submitted.html'
|