def _new(self): person_results = self.form_result['person'] proposal_results = self.form_result['proposal'] attachment_results = self.form_result['attachment'] proposal_results['status'] = ProposalStatus.find_by_name('Pending') c.proposal = Proposal(**proposal_results) meta.Session.add(c.proposal) if not h.signed_in_person(): c.person = model.Person(**person_results) meta.Session.add(c.person) email(c.person.email_address, render('/person/new_person_email.mako')) else: c.person = h.signed_in_person() for key in person_results: setattr(c.person, key, self.form_result['person'][key]) c.person.proposals.append(c.proposal) if attachment_results is not None: c.attachment = Attachment(**attachment_results) c.proposal.attachments.append(c.attachment) meta.Session.add(c.attachment) meta.Session.commit() email(c.person.email_address, render('proposal/thankyou_mini_email.mako')) h.flash("Proposal submitted!") return redirect_to(controller='proposal', action="index", id=None)
def _approve(self): c.highlight = set() talks = self.form_result['talk'] statuses = self.form_result['status'] for talk, status in zip(talks, statuses): if status is not None: c.highlight.add(talk.id) talk.status = status meta.Session.commit() c.proposals = Proposal.find_all() c.statuses = ProposalStatus.find_all() return render("proposal/approve.mako")
def _withdraw(self, id): if not h.auth.authorized(h.auth.Or(h.auth.is_same_zookeepr_submitter(id), h.auth.has_organiser_role)): # Raise a no_auth error h.auth.no_role() c.proposal = Proposal.find_by_id(id) status = ProposalStatus.find_by_name('Withdrawn') c.proposal.status = status meta.Session.commit() c.person = h.signed_in_person() # Make sure the organisers are notified of this c.email_address = h.lca_info['emails'][c.proposal.type.name.lower()] email(c.email_address, render('/proposal/withdraw_email.mako')) h.flash("Proposal withdrawn. The organisers have been notified.") return redirect_to(controller='proposal', action="index", id=None)
def _withdraw(self, id): if not h.auth.authorized( h.auth.Or(h.auth.is_same_zookeepr_submitter(id), h.auth.has_organiser_role)): # Raise a no_auth error h.auth.no_role() c.proposal = Proposal.find_by_id(id) status = ProposalStatus.find_by_name('Withdrawn') c.proposal.status = status meta.Session.commit() c.person = h.signed_in_person() # Make sure the organisers are notified of this c.email_address = h.lca_info['emails'][c.proposal.type.name.lower()] email(c.email_address, render('/proposal/withdraw_email.mako')) h.flash("Proposal withdrawn. The organisers have been notified.") return redirect_to(controller='proposal', action="index", id=None)
def _new(self): if c.cfp_status == 'closed': if not h.auth.authorized( h.auth.Or(h.auth.has_organiser_role, h.auth.has_late_submitter_role)): return render("proposal/closed.mako") elif c.cfp_status == 'not_open': return render("proposal/not_open.mako") person_results = self.form_result['person'] proposal_results = self.form_result['proposal'] attachment_results = self.form_result['attachment'] proposal_results['status'] = ProposalStatus.find_by_name('Pending') c.proposal = Proposal(**proposal_results) c.proposal.abstract = self.clean_abstract(c.proposal.abstract) meta.Session.add(c.proposal) if not h.signed_in_person(): c.person = model.Person(**person_results) meta.Session.add(c.person) email(c.person.email_address, render('/person/new_person_email.mako')) else: c.person = h.signed_in_person() for key in person_results: setattr(c.person, key, self.form_result['person'][key]) c.person.proposals.append(c.proposal) if attachment_results is not None: attachment = Attachment(**attachment_results) c.proposal.attachments.append(attachment) meta.Session.add(attachment) meta.Session.commit() email(c.person.email_address, render('proposal/thankyou_email.mako')) h.flash("Proposal submitted!") return redirect_to(controller='proposal', action="index", id=None)
def _new(self): if c.cfp_status == 'closed': if not h.auth.authorized(h.auth.Or(h.auth.has_organiser_role, h.auth.has_late_submitter_role)): return render("proposal/closed.mako") elif c.cfp_status == 'not_open': return render("proposal/not_open.mako") person_results = self.form_result['person'] proposal_results = self.form_result['proposal'] attachment_results = self.form_result['attachment'] proposal_results['status'] = ProposalStatus.find_by_name('Pending') c.proposal = Proposal(**proposal_results) c.proposal.abstract = self.clean_abstract(c.proposal.abstract) meta.Session.add(c.proposal) if not h.signed_in_person(): c.person = model.Person(**person_results) meta.Session.add(c.person) email(c.person.email_address, render('/person/new_person_email.mako')) else: c.person = h.signed_in_person() for key in person_results: setattr(c.person, key, self.form_result['person'][key]) c.person.proposals.append(c.proposal) if attachment_results is not None: attachment = Attachment(**attachment_results) c.proposal.attachments.append(attachment) meta.Session.add(attachment) meta.Session.commit() email(c.person.email_address, render('proposal/thankyou_email.mako')) h.flash("Proposal submitted!") return redirect_to(controller='proposal', action="index", id=None)
def approve(self): c.highlight = set() c.proposals = Proposal.find_all() c.statuses = ProposalStatus.find_all() return render("proposal/approve.mako")
def _to_python(self, value, state): return ProposalStatus.find_by_id(int(value))