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
This commit is contained in:
Russell Keith-Magee 2007-09-15 11:12:54 +00:00
parent 7a6abfdd3b
commit b361947745
1 changed files with 2 additions and 1 deletions

View File

@ -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):