This commit is contained in:
Ross
2021-09-21 18:36:58 +01:00
parent d30feb34ac
commit 7be9250e0f
2 changed files with 4 additions and 4 deletions
+3 -2
View File
@@ -204,9 +204,9 @@ class AddQuestionNote(CreateView):
def get_initial(self):
pk = self.kwargs["pk"]
question_type = self.kwargs["question_type"]
self.question_type = self.kwargs["question_type"]
question, content_type = get_question_and_content_type(question_type)
question, content_type = get_question_and_content_type(self.question_type)
self.question = get_object_or_404(question, pk=pk)
return { "content_type" : content_type,
@@ -216,6 +216,7 @@ class AddQuestionNote(CreateView):
# This can also be accessed via view.**** in the template
context = super(AddQuestionNote, self).get_context_data(**kwargs)
context['question'] = self.question
context['question_type'] = self.question_type
return context
def form_valid(self, form):