add a redirct view mixin
This commit is contained in:
+4
-5
@@ -54,6 +54,7 @@ from generic.views import (
|
||||
ExamUpdateBase,
|
||||
ExamViews,
|
||||
GenericViewBase,
|
||||
UpdateQuestionMixin,
|
||||
)
|
||||
|
||||
from reversion.views import RevisionMixin
|
||||
@@ -374,7 +375,9 @@ class RapidAnswerUpdate(RevisionMixin, AuthorOrCheckerRequiredMixin, UpdateView)
|
||||
return super().form_invalid(form)
|
||||
|
||||
|
||||
class RapidUpdate(RevisionMixin, AuthorOrCheckerRequiredMixin, UpdateView):
|
||||
class RapidUpdate(
|
||||
UpdateQuestionMixin,AuthorOrCheckerRequiredMixin
|
||||
):
|
||||
model = Rapid
|
||||
form_class = RapidForm
|
||||
|
||||
@@ -382,10 +385,6 @@ class RapidUpdate(RevisionMixin, AuthorOrCheckerRequiredMixin, UpdateView):
|
||||
# #fields = [ 'condition' ]
|
||||
# #initial = {'date_of_death': '05/01/2018'}
|
||||
# exclude = [ 'created_date', 'published_date' ]
|
||||
def get_form_kwargs(self):
|
||||
kwargs = super(RapidUpdate, self).get_form_kwargs()
|
||||
kwargs.update({"user": self.request.user})
|
||||
return kwargs
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(RapidUpdate, self).get_context_data(**kwargs)
|
||||
|
||||
Reference in New Issue
Block a user