Changed all explicitly set HttpResponse content_types to specify charset.
Django sets charset if you don't specify a content_type; if you specify one you also must add a charset specification (if you want one). Fixes issue #1647. - Legacy-Id: 9348
This commit is contained in:
parent
73664a484b
commit
2f54511763
|
@ -735,4 +735,4 @@ def charter_with_milestones_txt(request, name, rev):
|
|||
dict(charter_text=charter_text,
|
||||
milestones=milestones),
|
||||
context_instance=RequestContext(request),
|
||||
content_type="text/plain")
|
||||
content_type="text/plain; charset=%s"%settings.DEFAULT_CHARSET)
|
||||
|
|
|
@ -192,7 +192,7 @@ def agenda_txt(request, date=None):
|
|||
"date": data["date"],
|
||||
"sections": sorted(data["sections"].iteritems()),
|
||||
"domain": Site.objects.get_current().domain,
|
||||
}, context_instance=RequestContext(request), content_type="text/plain")
|
||||
}, context_instance=RequestContext(request), content_type="text/plain; charset=%s"%settings.DEFAULT_CHARSET)
|
||||
|
||||
def agenda_scribe_template(request, date=None):
|
||||
data = agenda_data(date)
|
||||
|
|
|
@ -482,7 +482,7 @@ def iprs_for_drafts_txt(request):
|
|||
for name, iprs in docipr.iteritems():
|
||||
lines.append(name + "\t" + "\t".join(unicode(ipr_id) for ipr_id in sorted(iprs)))
|
||||
|
||||
return HttpResponse("\n".join(lines), content_type="text/plain")
|
||||
return HttpResponse("\n".join(lines), content_type="text/plain; charset=%s"%settings.DEFAULT_CHARSET)
|
||||
|
||||
def new(request, type, updates=None):
|
||||
"""Submit a new IPR Disclosure. If the updates field != None, this disclosure
|
||||
|
|
|
@ -365,7 +365,12 @@ def agenda(request, num=None, name=None, base=None, ext=None):
|
|||
ext = ext if ext else '.html'
|
||||
if 'iPhone' in get_user_agent(request) and ext == ".html":
|
||||
base = 'm_agenda'
|
||||
mimetype = {".html":"text/html", ".txt": "text/plain", ".ics":"text/calendar", ".csv":"text/csv"}
|
||||
mimetype = {
|
||||
".html":"text/html; charset=%s"%settings.DEFAULT_CHARSET,
|
||||
".txt": "text/plain; charset=%s"%settings.DEFAULT_CHARSET,
|
||||
".ics":"text/calendar; charset=%s"%settings.DEFAULT_CHARSET,
|
||||
".csv":"text/csv; charset=%s"%settings.DEFAULT_CHARSET,
|
||||
}
|
||||
meeting = get_meeting(num)
|
||||
schedule = get_schedule(meeting, name)
|
||||
if schedule == None:
|
||||
|
@ -404,7 +409,7 @@ def session_agenda(request, num, session):
|
|||
ext = ext.lstrip(".").lower()
|
||||
|
||||
if ext == "txt":
|
||||
return HttpResponse(content, content_type="text/plain")
|
||||
return HttpResponse(content, content_type="text/plain; charset=%s"%settings.DEFAULT_CHARSET)
|
||||
elif ext == "pdf":
|
||||
return HttpResponse(content, content_type="application/pdf")
|
||||
else:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.contrib import messages
|
||||
from django.conf import settings
|
||||
from django.forms.models import inlineformset_factory
|
||||
from django.shortcuts import render_to_response, get_object_or_404, redirect
|
||||
from django.template import RequestContext
|
||||
|
@ -144,7 +145,7 @@ def blue_dot(request):
|
|||
|
||||
return render_to_response('groups/blue_dot_report.txt', {
|
||||
'chairs':sorted_chairs},
|
||||
RequestContext(request, {}), content_type="text/plain",
|
||||
RequestContext(request, {}), content_type="text/plain; charset=%s"%settings.DEFAULT_CHARSET,
|
||||
)
|
||||
|
||||
@role_required('Secretariat')
|
||||
|
|
|
@ -96,9 +96,9 @@ def notify(request, org, notification):
|
|||
failed, out = runscript("rfc-editor-index-updates")
|
||||
|
||||
if failed:
|
||||
return HttpResponseServerError("FAIL\n\n" + out, content_type="text/plain")
|
||||
return HttpResponseServerError("FAIL\n\n" + out, content_type="text/plain; charset=%s"%settings.DEFAULT_CHARSET)
|
||||
else:
|
||||
return HttpResponse("OK", content_type="text/plain")
|
||||
return HttpResponse("OK", content_type="text/plain; charset=%s"%settings.DEFAULT_CHARSET)
|
||||
|
||||
return render_to_response('sync/notify.html',
|
||||
dict(org=known_orgs[org],
|
||||
|
|
Loading…
Reference in a new issue