.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user