Browse Source

fixed proxy url errors in pdf html-view static css

pull/160/head
Mike Olund 8 years ago
parent
commit
d23ecb96a4
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      edivorce/apps/core/views/pdf.py

+ 7
- 1
edivorce/apps/core/views/pdf.py View File

@ -22,11 +22,17 @@ def form(request, form_number):
def render_form(request, form_name, context): def render_form(request, form_name, context):
output_as_html = request.GET.get('html', None) is not None
if output_as_html:
context["css_root"] = settings.FORCE_SCRIPT_NAME[:-1]
# render to form as HTML # render to form as HTML
rendered_html = render_to_string('pdf/' + form_name + '.html', context=context) rendered_html = render_to_string('pdf/' + form_name + '.html', context=context)
# if '?html' is in the querystring, then return the plain html # if '?html' is in the querystring, then return the plain html
if request.GET.get('html', None) is not None:
if output_as_html:
return HttpResponse(rendered_html) return HttpResponse(rendered_html)
else: else:


Loading…
Cancel
Save