Opened 8 years ago

Last modified 8 years ago

#27517 closed Bug

TemplateResponseMixin with charset does not worked — at Version 1

Reported by: Kosei Kitahara Owned by: nobody
Component: Generic views Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Kosei Kitahara)

When create class based view which contain TemplateResponseMixin,

class MyTemplateView(TemplateResponseMixin, ContextMixin, View):
    def get(self, request, *args, **kwargs):
        context = self.get_context_data(**kwargs)
        return self.render_to_response(context, charset=kwargs.get('charset', 'utf-8'))

TemplateResponseMixin.render_to_response call SimpleTemplateResponse. __init__ with a charset keyword argument.
But above method passed charset which is none-keyword argument.
Also content_type and status are same too.

Change History (1)

comment:1 by Kosei Kitahara, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top