.
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ logger = logging.getLogger(__name__)
|
||||
class AuthorOrCheckerRequiredMixin(object):
|
||||
def get_object(self, *args, **kwargs):
|
||||
obj = super(UpdateView, self).get_object(*args, **kwargs)
|
||||
if self.request.user.groups.filter(name="long_checker").exists():
|
||||
if self.request.user.groups.filter(name="long_checker").exists() or self.request.user.is_superuser:
|
||||
return obj
|
||||
if self.request.user not in obj.get_author_objects():
|
||||
raise PermissionDenied() # or Http404
|
||||
|
||||
Reference in New Issue
Block a user