Ticket #170: main.py.patch
File main.py.patch, 2.9 KB (added by , 19 years ago) |
---|
-
main.py
48 48 def index(request): 49 49 t = template_loader.get_template('index') 50 50 c = Context(request, {'title': 'Site administration'}) 51 return HttpResponse(t.render(c) )51 return HttpResponse(t.render(c), mimetype='text/html; charset=utf-8') 52 52 53 53 def change_list(request, app_label, module_name): 54 54 from django.core import paginator … … 491 491 'title': (is_popup and 'Select %s' % opts.verbose_name or 'Select %s to change' % opts.verbose_name), 492 492 'is_popup': is_popup, 493 493 }) 494 return HttpResponse(t.render(c) )494 return HttpResponse(t.render(c), mimetype='text/html; charset=utf-8') 495 495 496 496 def _get_flattened_data(field, val): 497 497 """ … … 777 777 return HttpResponseRedirect(post_url_continue % new_object.id) 778 778 if request.POST.has_key("_popup"): 779 779 return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \ 780 (getattr(new_object, opts.pk.name), repr(new_object).replace('"', '\\"'))) 780 (getattr(new_object, opts.pk.name), repr(new_object).replace('"', '\\"')), 781 mimetype='text/html; charset=utf-8') 781 782 elif request.POST.has_key("_addanother"): 782 783 request.user.add_message("%s You may add another %s below." % (msg, opts.verbose_name)) 783 784 return HttpResponseRedirect(request.path) … … 840 841 raw_template = _get_template(opts, app_label, add=True, show_delete=show_delete, form_url=form_url) 841 842 # return HttpResponse(raw_template, mimetype='text/plain') 842 843 t = template_loader.get_template_from_string(raw_template) 843 return HttpResponse(t.render(c) )844 return HttpResponse(t.render(c), mimetype='text/html; charset=utf-8') 844 845 845 846 def change_stage(request, app_label, module_name, object_id): 846 847 mod, opts = _get_mod_opts(app_label, module_name) … … 956 957 raw_template = _get_template(opts, app_label, change=True) 957 958 # return HttpResponse(raw_template, mimetype='text/plain') 958 959 t = template_loader.get_template_from_string(raw_template) 959 return HttpResponse(t.render(c) )960 return HttpResponse(t.render(c), mimetype='text/html; charset=utf-8') 960 961 961 962 def _nest_help(obj, depth, val): 962 963 current = obj … … 1072 1073 "deleted_objects": deleted_objects, 1073 1074 "perms_lacking": perms_needed, 1074 1075 }) 1075 return HttpResponse(t.render(c) )1076 return HttpResponse(t.render(c), mimetype='text/html; charset=utf-8') 1076 1077 1077 1078 def history(request, app_label, module_name, object_id): 1078 1079 mod, opts = _get_mod_opts(app_label, module_name) … … 1090 1091 'module_name': meta.capfirst(opts.verbose_name_plural), 1091 1092 'object': obj, 1092 1093 }) 1093 return HttpResponse(t.render(c) )1094 return HttpResponse(t.render(c), mimetype='text/html; charset=utf-8')