Permalink
Browse files

Fixing kwargs argument passing from decorator to rendering

  • Loading branch information...
1 parent 3a3c059 commit de9d0fe23624607405f30ef7209c72d0c9948198 @sametmax committed Nov 9, 2013
Showing with 9 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +8 −3 django_quicky/decorators.py
View
@@ -15,6 +15,7 @@
*.pyc
*.pyo
+
# files generated by setuptools
*.egg-info
@@ -93,6 +93,9 @@ def ajax_user_view(request, id, context):
a dictionary which will be rendered as json.
"""
+ decorator_args = args
+ decorator_kwargs = kwargs
+
def decorator(func):
func.conditional_calls = []
@@ -122,11 +125,13 @@ def wrapper(request, *args, **kwargs):
if rendering == 'json':
return HttpResponse(json.dumps(response),
mimetype="application/json",
- *args, **kwargs)
+ *decorator_args, **decorator_kwargs)
if rendering == 'raw':
- return HttpResponse(response, *args, **kwargs)
+ return HttpResponse(response,
+ *decorator_args, **decorator_kwargs)
- return render(request, rendering, response, *args, **kwargs)
+ return render(request, rendering, response,
+ *decorator_args, **decorator_kwargs)
return response

0 comments on commit de9d0fe

Please sign in to comment.