You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
486 B

from django.http import HttpResponseForbidden
class CheckForUserMixin(object):
def dispatch(self, request, *args, **kwargs):
# if request.user.is_authenticated():
# pk = kwargs.get('pk')
# if pk:
# if request.user.pk != int(pk):
# return HttpResponseForbidden('403 Forbidden')
# else:
# return HttpResponseForbidden('403 Forbidden')
return super().dispatch(request, *args, **kwargs)