def _processIfActive(self): tz = timezoneUtils.DisplayTZ(self._aw, self._conf).getDisplayTZ() cfaMgr = self._conf.getAbstractMgr() abstracts = set(cfaMgr.getAbstractListForAvatar(self._aw.getUser())) abstracts |= set(cfaMgr.getAbstractListForAuthorEmail(self._aw.getUser().getEmail())) self._abstractIds = sorted(abstract.getId() for abstract in abstracts) if not self._abstractIds: return _("No abstract to print") filename = 'my-abstracts.pdf' pdf = AbstractsToPDF(self._conf, self._abstractIds, tz=tz) return send_file(filename, pdf.generate(), 'PDF')
def _processIfActive(self): tz = timezoneUtils.DisplayTZ(self._aw, self._conf).getDisplayTZ() cfaMgr = self._conf.getAbstractMgr() abstracts = set(cfaMgr.getAbstractListForAvatar(self._aw.getUser())) abstracts |= set( cfaMgr.getAbstractListForAuthorEmail( self._aw.getUser().getEmail())) self._abstractIds = sorted(abstract.getId() for abstract in abstracts) if not self._abstractIds: return _("No abstract to print") filename = 'my-abstracts.pdf' pdf = AbstractsToPDF(self._conf, self._abstractIds, tz=tz) return send_file(filename, pdf.generate(), 'PDF')
def _process(self): pdf = AbstractsToPDF(self.event_new, get_user_abstracts(self.event_new, session.user)) return send_file('my-abstracts.pdf', pdf.generate(), 'application/pdf')