dossiers: use custom redirect class to avoid django choking on file:// (#2135)

This commit is contained in:
Frédéric Péters 2013-01-06 17:20:51 +01:00
parent d13627d7e9
commit 02f3925197
1 changed files with 3 additions and 1 deletions

View File

@ -634,8 +634,10 @@ class GenerateRtfFormView(cbv.FormView):
response.write(file(to_path).read())
return response
else:
class LocalFileHttpResponseRedirect(HttpResponseRedirect):
allowed_schemes = ['file']
client_filepath = os.path.join(client_dir, dest_filename)
return HttpResponseRedirect('file://' + client_filepath)
return LocalFileHttpResponseRedirect('file://' + client_filepath)
generate_rtf_form = GenerateRtfFormView.as_view()