This commit is contained in:
Ross
2021-05-04 23:27:35 +01:00
parent 59ae57d7f0
commit a7826c003b
3 changed files with 38 additions and 4 deletions
+2 -2
View File
@@ -55,8 +55,8 @@ urlpatterns = [
path("exam/json/unbased", views.active_exams_unbased, name="active_exams_unbased"),
path("exam/submit", views.exam_submit, name="global_exam_answers_submit"),
#path('', include('generic.urls')),
path("feedback/<str:question_type>/<int:pk>", views.feedback_create, name="feedback_create"),
path("feedback/", views.AddQuestionNote.as_view(), name="feedback"),
path("feedback/<str:question_type>/<int:pk>", views.AddQuestionNote.as_view(), name="feedback_create"),
#path("feedback/", views.AddQuestionNote.as_view(), name="feedback"),
path('api/', include(router.urls)),
+7 -1
View File
@@ -160,4 +160,10 @@ def feedback_create(request, question_type, pk):
class AddQuestionNote(LoginRequiredMixin, CreateView):
model = QuestionNote
form_class = QuestionNoteForm
form_class = QuestionNoteForm
def get_form_kwargs(self):
kwargs = super(AddQuestionNote, self).get_form_kwargs()
# update the kwargs for the form init method with yours
kwargs.update(self.kwargs) # self.kwargs contains all url conf params
return kwargs