aboutsummaryrefslogblamecommitdiffstats
path: root/ctrack/register/views.py
blob: deae4229f81f809d7eb814c03dead0769418e0b8 (plain) (tree)
1
2
3
4
5



                                                         
 











                                                                  
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.urls import reverse, reverse_lazy
from django.views.generic import FormView

from ctrack.register.forms import EngagementEventCreateForm


class EngagementEventCreate(LoginRequiredMixin, FormView):
    fields = "__all__"
    form_class = EngagementEventCreateForm
    template_name = "register/engagementevent_form.html"
    success_url = reverse_lazy("organisations:list")

    def form_valid(self, form):
        form.save()
        return HttpResponseRedirect(reverse("organisations:list"))