Add default charset for Django settings; change from default pdf output to html
svn: r23380
This commit is contained in:
parent
83fc3ad4e8
commit
39a3f50a96
@ -206,7 +206,7 @@ def process_report_run(request, handle):
|
||||
if request.user.is_authenticated():
|
||||
profile = request.user.get_profile()
|
||||
report = Report.objects.get(handle=handle)
|
||||
args = {"off": "pdf", "iff": "ged"} # basic defaults
|
||||
args = {"off": "html"} # basic defaults
|
||||
# override from given defaults in table:
|
||||
if report.options:
|
||||
for pair in str(report.options).split("\\n"):
|
||||
@ -268,6 +268,16 @@ def process_report_run(request, handle):
|
||||
make_message(request, "Failed: '%s' is not found" % filename)
|
||||
return redirect("/report/")
|
||||
time.sleep(1)
|
||||
# FIXME: the following should go into a queue for later presentation
|
||||
# like a jobs-result queue
|
||||
if filename.endswith(".html"):
|
||||
# just give it, perhaps in a new tab
|
||||
from django.http import HttpResponse
|
||||
response = HttpResponse(mimetype="text/html")
|
||||
content = "".join(open(filename).readlines())
|
||||
response._set_content(content)
|
||||
return response
|
||||
else:
|
||||
return send_file(request, filename, mimetype)
|
||||
# If failure, just fail for now:
|
||||
context = RequestContext(request)
|
||||
|
@ -156,4 +156,5 @@ CACHES = {
|
||||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
||||
}
|
||||
}
|
||||
DEFAULT_CHARSET = "utf-8"
|
||||
## End Changes for Django 1.5
|
||||
|
Loading…
Reference in New Issue
Block a user