mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
adaptations for settings and deletion checked
This commit is contained in:
@ -67,7 +67,7 @@ class CanEditPropMixin(View):
|
||||
except: pass
|
||||
# If we get here, it's a ListView
|
||||
l_id = [o.id for o in self.get_queryset() if can_edit_prop(o, request.user)]
|
||||
if not l_id:
|
||||
if not l_id and self.get_queryset().count() != 0:
|
||||
raise PermissionDenied
|
||||
self._get_queryset = self.get_queryset
|
||||
def get_qs(self2):
|
||||
@ -89,7 +89,7 @@ class CanEditMixin(View):
|
||||
except: pass
|
||||
# If we get here, it's a ListView
|
||||
l_id = [o.id for o in self.get_queryset() if can_edit(o, request.user)]
|
||||
if not l_id:
|
||||
if not l_id and self.get_queryset().count() != 0:
|
||||
raise PermissionDenied
|
||||
self._get_queryset = self.get_queryset
|
||||
def get_qs(self2):
|
||||
@ -111,7 +111,7 @@ class CanViewMixin(View):
|
||||
except: pass
|
||||
# If we get here, it's a ListView
|
||||
l_id = [o.id for o in self.get_queryset() if can_view(o, request.user)]
|
||||
if ((not l_id) and self.get_queryset().count() != 0):
|
||||
if not l_id and self.get_queryset().count() != 0:
|
||||
raise PermissionDenied
|
||||
self._get_queryset = self.get_queryset
|
||||
def get_qs(self2):
|
||||
|
Reference in New Issue
Block a user