Changeset 15128 for main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/utils.py
- Timestamp:
- 6 Sep 2018, 11:16:55 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/utils.py
r15102 r15128 20 20 import grok 21 21 from time import time 22 from cStringIO import StringIO 22 23 from reportlab.lib import colors 23 24 from reportlab.lib.units import cm … … 33 34 from waeup.kofa.interfaces import ( 34 35 IExtFileStore, IKofaUtils, RETURNING, PAID, CLEARED, 35 academic_sessions_vocab )36 academic_sessions_vocab, IFileStoreNameChooser) 36 37 from waeup.kofa.interfaces import MessageFactory as _ 37 38 from waeup.kofa.students.interfaces import IStudentsUtils … … 854 855 level_obj.cumulative_params[0], level_obj.student)[0] 855 856 857 def _saveTranscriptPDF(self, student, transcript): 858 """Create a transcript PDF file and store it in student folder. 859 """ 860 file_store = getUtility(IExtFileStore) 861 file_id = IFileStoreNameChooser(student).chooseName( 862 attr="transcript.pdf") 863 file_store.createFile(file_id, StringIO(transcript)) 864 return 865 856 866 def renderPDFTranscript(self, view, filename='transcript.pdf', 857 867 student=None, … … 861 871 omit_fields=(), 862 872 tableheader=None, 863 no_passport=False): 873 no_passport=False, 874 save_file=False): 864 875 """Render pdf slip of a transcripts. 865 876 """ … … 966 977 view.flash(_('Error in image file.')) 967 978 return view.redirect(view.url(view.context)) 979 if save_file: 980 self._saveTranscriptPDF(student, pdf_stream) 968 981 return pdf_stream 969 982
Note: See TracChangeset for help on using the changeset viewer.