Save the form type (long, short) with the case study

This commit is contained in:
2019-03-04 20:41:15 +00:00
parent 3c45e38fd5
commit f8d4cfe755
3 changed files with 24 additions and 0 deletions

View File

@ -119,6 +119,7 @@ class BaseCreateForm(LoginRequiredMixin, FilesHandlerMixin, CreateView):
self.object.author = self.request.user
self.object.language = get_language()
self.object.form_type = self.form_type
self.object.save()
send_email(self.object.id)
@ -130,11 +131,13 @@ class BaseCreateForm(LoginRequiredMixin, FilesHandlerMixin, CreateView):
class CreateShortCaseStudy(BaseCreateForm):
"""View for short version of case study form."""
form_class = ShortCaseStudyForm
form_type = "short"
class CreateLongCaseStudy(BaseCreateForm):
"""View for long version of case study form."""
form_class = LongCaseStudyForm
form_type = "long"
class CreateCaseStudySuccess(TemplateView):