This commit is contained in:
Ross
2021-02-17 21:49:25 +00:00
parent d521cee235
commit 326c155c24
17 changed files with 68 additions and 4 deletions
+4 -1
View File
@@ -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)