add option to save html dir (debug html to pdf)
authorJan Szejko <janek37@gmail.com>
Thu, 15 Mar 2018 14:43:54 +0000 (15:43 +0100)
committerJan Szejko <janek37@gmail.com>
Thu, 15 Mar 2018 14:43:54 +0000 (15:43 +0100)
catalogue/models.py

index 4a21790..7d782ad 100644 (file)
@@ -239,10 +239,10 @@ class Lesson(models.Model):
             pdf = PdfFormat(wldoc, teacher=True).build()
             self.pdf.save("%s.pdf" % self.slug, File(open(pdf.get_filename())))
 
             pdf = PdfFormat(wldoc, teacher=True).build()
             self.pdf.save("%s.pdf" % self.slug, File(open(pdf.get_filename())))
 
-    def build_weasy_pdf(self):
+    def build_weasy_pdf(self, **kwargs):
         from .publish import WeasyFormat
         wldoc = self.wldocument()
         from .publish import WeasyFormat
         wldoc = self.wldocument()
-        pdf = WeasyFormat(wldoc, media_root=settings.MEDIA_ROOT).build()
+        pdf = WeasyFormat(wldoc, media_root=settings.MEDIA_ROOT, **kwargs).build()
         self.weasy_pdf.save("%s.pdf" % self.slug, File(open(pdf.get_filename())))
 
     def add_to_zip(self, zipf, student=False, prefix=''):
         self.weasy_pdf.save("%s.pdf" % self.slug, File(open(pdf.get_filename())))
 
     def add_to_zip(self, zipf, student=False, prefix=''):