From b361947745971eac1f875271cf084c0516496264 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 15 Sep 2007 11:12:54 +0000 Subject: [PATCH] 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 --- django/views/generic/simple.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/views/generic/simple.py b/django/views/generic/simple.py index 69a494931e3..9d7efdc6c4d 100644 --- a/django/views/generic/simple.py +++ b/django/views/generic/simple.py @@ -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):