From: Jan Szejko Date: Thu, 15 Mar 2018 14:43:54 +0000 (+0100) Subject: add option to save html dir (debug html to pdf) X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/460318dfedf9128350ed4246026cf50641acb3d5?ds=sidebyside add option to save html dir (debug html to pdf) --- diff --git a/catalogue/models.py b/catalogue/models.py index 4a21790..7d782ad 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -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()))) - def build_weasy_pdf(self): + def build_weasy_pdf(self, **kwargs): 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=''):