示例#1
0
 def inner(request, *args, **kwargs):
     '''implementation'''
     try:
         Tbluser.objects.get(id=request.session.get("user_id"))
     except Tbluser.DoesNotExist:
         info_log.info("Non-logged in user accessing @loggedin page")
         raise Http404
     return func(request, *args, **kwargs)
 def inner(request, *args, **kwargs):
     '''implementation'''
     try:
         Tbluser.objects.get(id=request.session.get("user_id"))
     except Tbluser.DoesNotExist:
         info_log.info("Non-logged in user accessing @loggedin page")
         raise Http404
     return func(request, *args, **kwargs)
 def inner(request, **kwargs):
     '''implementation'''
     if settings.DEBUG: # pragma: no cover
         return func(request, **kwargs)
     try:
         user = Tbluser.objects.get(
             id=request.session.get('user_id', None)
         )
     except Tbluser.DoesNotExist:
         info_log.info("Non-logged in user accessing @loggedin page")
         raise Http404
     if user.user_type not in permission:
         suspicious_log.info("Non-admin user accessing @permission page: %s", user.name())
         raise Http404
     else:
         return func(request, **kwargs)
示例#4
0
 def inner(request, **kwargs):
     '''implementation'''
     if settings.DEBUG:  # pragma: no cover
         return func(request, **kwargs)
     try:
         user = Tbluser.objects.get(
             id=request.session.get('user_id', None))
     except Tbluser.DoesNotExist:
         info_log.info("Non-logged in user accessing @loggedin page")
         raise Http404
     if user.user_type not in permission:
         suspicious_log.info(
             "Non-admin user accessing @permission page: %s",
             user.name())
         raise Http404
     else:
         return func(request, **kwargs)