Add picture-people relation and ask for removal thing

This commit is contained in:
Skia
2016-11-19 17:19:00 +01:00
parent b619619b85
commit 22ab21e4e1
9 changed files with 221 additions and 18 deletions

View File

@ -58,6 +58,8 @@ class CanEditPropMixin(View):
"""
def dispatch(self, request, *arg, **kwargs):
res = super(CanEditPropMixin, self).dispatch(request, *arg, **kwargs)
if res.__class__.status_code == 302:
return res
if hasattr(self, 'object'):
obj = self.object
elif hasattr(self, 'object_list'):
@ -76,6 +78,8 @@ class CanEditMixin(View):
"""
def dispatch(self, request, *arg, **kwargs):
res = super(CanEditMixin, self).dispatch(request, *arg, **kwargs)
if res.__class__.status_code == 302:
return res
if hasattr(self, 'object'):
obj = self.object
elif hasattr(self, 'object_list'):
@ -94,6 +98,8 @@ class CanViewMixin(View):
"""
def dispatch(self, request, *arg, **kwargs):
res = super(CanViewMixin, self).dispatch(request, *arg, **kwargs)
if res.__class__.status_code == 302:
return res
if hasattr(self, 'object'):
obj = self.object
elif hasattr(self, 'object_list'):