Exemple #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()
Exemple #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()
Exemple #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()
Exemple #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()