This commit is contained in:
Ross
2022-05-21 22:09:37 +01:00
parent 851e681400
commit 781b6bc1fe
26 changed files with 311 additions and 70 deletions
+6
View File
@@ -71,6 +71,12 @@ import plotly.express as px
# from rad.views import get_question_and_content_type
from django.db.models import Prefetch
class AuthorRequiredMixin(object):
def get_object(self, *args, **kwargs):
obj = super().get_object(*args, **kwargs)
if self.request.user not in obj.author.all():
raise PermissionDenied() # or Http404
return obj
class CidManagerRequiredMixin(UserPassesTestMixin):
def test_func(self):