.
This commit is contained in:
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.shortcuts import render, get_object_or_404, redirect
|
from django.shortcuts import render, get_object_or_404, redirect
|
||||||
|
|
||||||
from django.contrib.auth.decorators import login_required, user_passes_test
|
from django.contrib.auth.decorators import login_required, user_passes_test
|
||||||
@@ -43,13 +44,13 @@ import os
|
|||||||
|
|
||||||
def get_question_and_content_type(question_type):
|
def get_question_and_content_type(question_type):
|
||||||
if question_type == "rapid":
|
if question_type == "rapid":
|
||||||
question = Rapid
|
question = RapidQuestion
|
||||||
content_type = ContentType.objects.get(model="rapid")
|
content_type = ContentType.objects.get(model="rapid")
|
||||||
elif question_type == "anatomy":
|
elif question_type == "anatomy":
|
||||||
question = AnatomyQuestion
|
question = AnatomyQuestion
|
||||||
content_type = ContentType.objects.get(model="anatomyquestion")
|
content_type = ContentType.objects.get(model="anatomyquestion")
|
||||||
elif question_type == "long":
|
elif question_type == "long":
|
||||||
question = Long
|
question = LongQuestion
|
||||||
content_type = ContentType.objects.get(model="long")
|
content_type = ContentType.objects.get(model="long")
|
||||||
else:
|
else:
|
||||||
raise PermissionError()
|
raise PermissionError()
|
||||||
|
|||||||
Reference in New Issue
Block a user