Fixing STATIC_FORMS_ROOT search path

This commit is contained in:
Mark Riedesel 2013-11-10 20:31:21 -06:00
parent 440163e504
commit 77713d81b0
3 changed files with 9 additions and 3 deletions

View file

@ -18,7 +18,7 @@ class PDFFormFillerEditor(View):
def load_poppler_doc(self, filename):
from django.conf import settings
pdf_path = os.path.abspath(os.path.join(settings.STATIC_FORMS_ROOT, filename))
pdf_path = os.path.abspath(os.path.join(getattr(settings, 'STATIC_FORMS_ROOT', ''), filename))
if os.path.isfile(pdf_path):
return poppler.document_new_from_file('file://' + pdf_path, password=None)