.
This commit is contained in:
+5
-3
@@ -67,9 +67,10 @@ from django.db.models import Prefetch
|
||||
|
||||
|
||||
class CidManagerRequiredMixin(UserPassesTestMixin):
|
||||
|
||||
def test_func(self):
|
||||
return self.request.user.groups.filter(name="cid_user_manager").exists()
|
||||
|
||||
|
||||
# def get_object(self, *args, **kwargs):
|
||||
# obj = super().get_object(*args, **kwargs)
|
||||
# if self.request.user.groups.filter(name="cid_user_manager").exists():
|
||||
@@ -299,7 +300,9 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
return False
|
||||
if (
|
||||
self.app_name == "anatomy"
|
||||
and not user.groups.filter(name="anatomy_checker").exists()
|
||||
and not user.groups.filter(
|
||||
name__in=["anatomy_checker", "anatomy_feedback"]
|
||||
).exists()
|
||||
):
|
||||
return False
|
||||
if (
|
||||
@@ -373,7 +376,6 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
|
||||
exam = get_object_or_404(self.Exam, pk=pk)
|
||||
|
||||
|
||||
exam.publish_results = (
|
||||
True if request.POST.get("publish_results") == "true" else False
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user