.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from physics.decorators import user_is_author_or_physics_checker
|
||||
from physics.filters import QuestionFilter, UserAnswerFilter
|
||||
from generic.mixins import SuperuserRequiredMixin
|
||||
from physics.tables import QuestionTable, UserAnswerTable
|
||||
@@ -46,6 +47,7 @@ from rest_framework.pagination import PageNumberPagination
|
||||
from django.core.exceptions import PermissionDenied
|
||||
|
||||
from .forms import ExamForm
|
||||
from .decorators import user_is_author_or_physics_checker, user_is_exam_author_or_physics_checker
|
||||
|
||||
class AuthorOrCheckerRequiredMixin(object):
|
||||
def get_object(self, *args, **kwargs):
|
||||
@@ -62,6 +64,7 @@ def question_list(request):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_author_or_physics_checker
|
||||
def question_detail(request, pk):
|
||||
question = get_object_or_404(Question, pk=pk)
|
||||
return render(request, "physics/question_detail.html", {"question": question})
|
||||
|
||||
Reference in New Issue
Block a user