.
This commit is contained in:
@@ -3,11 +3,10 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Add Feedback</h2>
|
<h2>Add Feedback</h2>
|
||||||
|
Adding feedback for {{question_type}} question - {{question}}
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form.non_field_errors }}
|
{{ form.non_field_errors }}
|
||||||
{{question}}
|
|
||||||
{{question.pk}}
|
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
User: {{user}}
|
User: {{user}}
|
||||||
|
|||||||
+3
-2
@@ -204,9 +204,9 @@ class AddQuestionNote(CreateView):
|
|||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
pk = self.kwargs["pk"]
|
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)
|
self.question = get_object_or_404(question, pk=pk)
|
||||||
return { "content_type" : content_type,
|
return { "content_type" : content_type,
|
||||||
@@ -216,6 +216,7 @@ class AddQuestionNote(CreateView):
|
|||||||
# This can also be accessed via view.**** in the template
|
# This can also be accessed via view.**** in the template
|
||||||
context = super(AddQuestionNote, self).get_context_data(**kwargs)
|
context = super(AddQuestionNote, self).get_context_data(**kwargs)
|
||||||
context['question'] = self.question
|
context['question'] = self.question
|
||||||
|
context['question_type'] = self.question_type
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
|
|||||||
Reference in New Issue
Block a user