mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #17228 -- params context variable is inconsistent
Remove the params variable from the context and just put the variables in directly. This had not been committed previously as the original pattern was used in the functional generic views and we wanted consistency between them, but django.views.generic.simple.direct_to_template is now gone so we can do it 'right'.
This commit is contained in:
committed by
Andrew Godwin
parent
212b9826bd
commit
f04bb6d798
@@ -142,11 +142,11 @@ class TemplateResponseMixin(object):
|
||||
|
||||
class TemplateView(TemplateResponseMixin, ContextMixin, View):
|
||||
"""
|
||||
A view that renders a template. This view is different from all the others
|
||||
insofar as it also passes ``kwargs`` as ``params`` to the template context.
|
||||
A view that renders a template. This view will also pass into the context
|
||||
any keyword arguments passed by the url conf.
|
||||
"""
|
||||
def get(self, request, *args, **kwargs):
|
||||
context = self.get_context_data(params=kwargs)
|
||||
context = self.get_context_data(**kwargs)
|
||||
return self.render_to_response(context)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user