Changeset 16160


Ignore:
Timestamp:
10 Jul 2020, 06:13:51 (4 years ago)
Author:
Henrik Bettermann
Message:

Use file merger.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r16150 r16160  
    1717##
    1818import grok
     19import os
    1920from zope.i18n import translate
    2021from zope.schema.interfaces import ConstraintNotSatisfied
     
    302303    def render(self):
    303304        students_utils = getUtility(IStudentsUtils)
     305        watermark_path = os.path.join(
     306            os.path.dirname(__file__), 'static', 'watermark.pdf')
     307        watermark = open(watermark_path, 'rb')
     308        file_path = os.path.join(
     309            os.path.dirname(__file__), 'static', 'admission_letter.pdf')
     310        file = open(file_path, 'rb')
     311        mergefiles = [file,]
    304312        return students_utils.renderPDFAdmissionLetter(self,
    305313            self.context.student, omit_fields=self.omit_fields,
    306             pre_text=self.pre_text, post_text=self.post_text)
     314            pre_text=self.pre_text, post_text=self.post_text,
     315            mergefiles=mergefiles,
     316            watermark=watermark)
Note: See TracChangeset for help on using the changeset viewer.