def _doValidate(self): #First, one must validate that the information is fine errors = self._abstractData.check() if errors: p = abstracts.WPAbstractSubmission(self, self._target) pars = self._abstractData.toDict() pars["action"] = self._action pars["attachments"] = [] for error in errors: flash(error, 'error') return p.display(**pars) #Then, we create the abstract object and set its data to the one # received cfaMgr = self._target.getAbstractMgr() abstract = cfaMgr.newAbstract(self._getUser()) self._abstractData.setAbstractData(abstract) #The commit must be forced before sending the confirmation DBMgr.getInstance().commit() #Email confirmation about the submission mail.Mailer.send( _AbstractSubmissionNotification(abstract), self._conf.getSupportInfo().getEmail(returnNoReply=True)) #Email confirmation about the submission to coordinators if cfaMgr.getSubmissionNotification().hasDestination(): asn = _AbstractSubmissionNotification(abstract) asn.setSubject( _("[Indico] New abstract submission: %s") % asn.getDestination().getFullName()) mail.GenericMailer.send(asn) #We must perform some actions: email warning to the authors #Finally, we display a confirmation form self._redirect( urlHandlers.UHAbstractSubmissionConfirmation.getURL(abstract))
def _processIfOpened(self): if self._action == "CANCEL": self._redirect(urlHandlers.UHConferenceCFA.getURL(self._conf)) elif self._action == "VALIDATE": return self._doValidate() else: p = abstracts.WPAbstractSubmission(self, self._target) pars = self._abstractData.toDict() return p.display(**pars)
def _doValidate(self): #First, one must validate that the information is fine errors = self._abstractData.check() if errors: p = abstracts.WPAbstractSubmission(self, self._target) pars = self._abstractData.toDict() pars["errors"] = errors pars["action"] = self._action return p.display(**pars) #Then, we create the abstract object and set its data to the one # received cfaMgr = self._target.getAbstractMgr() afm = cfaMgr.getAbstractFieldsMgr() a = cfaMgr.newAbstract(self._getUser()) a.setTitle(self._abstractData.title) for f in afm.getFields(): id = f.getId() a.setField(id, self._abstractData.getFieldValue(id)) for authData in self._abstractData.authors.getPrimaryList(): auth=a.newPrimaryAuthor(title = authData["auth_title"], \ firstName = authData["auth_firstName"], \ surName = authData["auth_surName"], \ email = authData["auth_email"], \ affiliation = authData["auth_affiliation"], \ address = authData["auth_address"], \ telephone = authData["auth_phone"] ) if authData["auth_speaker"]: a.addSpeaker(auth) for authData in self._abstractData.authors.getSecondaryList(): auth=a.newCoAuthor(title = authData["auth_title"], \ firstName = authData["auth_firstName"], \ surName = authData["auth_surName"], \ email = authData["auth_email"], \ affiliation = authData["auth_affiliation"], \ address = authData["auth_address"], \ telephone = authData["auth_phone"] ) if authData["auth_speaker"]: a.addSpeaker(auth) a.setContribType(self._abstractData.type) for trackId in self._abstractData.tracks: track = self._conf.getTrackById(trackId) a.addTrack(track) a.setComments(self._abstractData.comments) #The commit must be forced before sending the confirmation DBMgr.getInstance().commit() #Email confirmation about the submission mail.Mailer.send(_AbstractSubmissionNotification(a)) #Email confirmation about the submission to coordinators if cfaMgr.getSubmissionNotification().hasDestination(): asn = _AbstractSubmissionNotification(a) asn.setSubject( _("[Indico] New abstract submission: %s") % asn.getDestination().getFullName()) mail.GenericMailer.send(asn) #We must perform some actions: email warning to the authors #Finally, we display a confirmation form self._redirect(urlHandlers.UHAbstractSubmissionConfirmation.getURL(a))