.
This commit is contained in:
+4
-1
@@ -70,7 +70,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class AuthorOrCheckerRequiredMixin(object):
|
||||
def get_object(self, *args, **kwargs):
|
||||
obj = super(UpdateView, self).get_object(*args, **kwargs)
|
||||
obj = super().get_object(*args, **kwargs)
|
||||
if self.request.user.groups.filter(name="rapid_checker").exists():
|
||||
return obj
|
||||
if self.request.user not in obj.author.all():
|
||||
@@ -871,5 +871,8 @@ def exam_scores_cid_user(request, pk, sk):
|
||||
)
|
||||
|
||||
|
||||
class QuestionDelete(AuthorOrCheckerRequiredMixin, DeleteView):
|
||||
model = Rapid
|
||||
success_url = reverse_lazy("rapids:rapid_view")
|
||||
|
||||
RapidExamViews = ExamViews(Exam, "rapids", "rapid", loadJsonAnswer)
|
||||
Reference in New Issue
Block a user