示例#1
0
        def wrapper(request, *args, **kwargs):
            if authenticate and not request.user.is_authenticated():
                has_auth = False
                res = iter([])
            else:
                has_auth = True
                res = func(request, *args, **kwargs)

            response = SniperResponse(request, res, has_auth)
            return response.to_ajax_response()
示例#2
0
 def wrapper(request, *args, **kwargs):
   if authenticate and not request.user.is_authenticated():
     has_auth = False
     res = iter([])
   else:
     has_auth = True
     res = func(request, *args, **kwargs)
   
   response = SniperResponse(request, res, has_auth)
   return response.to_ajax_response()
示例#3
0
 def wrapper(request, *args, **kwargs):
     has_auth = True
     res = func(request, *args, **kwargs)
     response = SniperResponse(request, res, has_auth)
     return response.to_template_response()
示例#4
0
 def wrapper(request, *args, **kwargs):
   has_auth = True
   res = func(request, *args, **kwargs)
   response = SniperResponse(request, res, has_auth)
   return response.to_template_response()