Kaydet (Commit) b3619477 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Fixed #5468 -- Fixed the handling of the context argument in direct_to_template…

Fixed #5468 -- Fixed the handling of the context argument in direct_to_template generic views. Thanks, durdinator.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 7a6abfdd
......@@ -2,11 +2,12 @@ from django.shortcuts import render_to_response
from django.template import loader, RequestContext
from django.http import HttpResponse, HttpResponsePermanentRedirect, HttpResponseGone
def direct_to_template(request, template, extra_context={}, mimetype=None, **kwargs):
def direct_to_template(request, template, extra_context=None, mimetype=None, **kwargs):
"""
Render a given template with any extra URL parameters in the context as
``{{ params }}``.
"""
if extra_context is None: extra_context = {}
dictionary = {'params': kwargs}
for key, value in extra_context.items():
if callable(value):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment