Exemplo n.º 1
0
 def _process(self):
     form = AgreementForm()
     if form.validate_on_submit() and self.agreement.pending:
         reason = form.reason.data if form.agreed.data else None
         func = self.agreement.accept if form.agreed.data else self.agreement.reject
         func(from_ip=request.remote_addr, reason=reason)
         if self.agreement.definition.event_settings.get(self._conf, 'manager_notifications_enabled'):
             notify_new_signature_to_manager(self.agreement)
         return redirect(url_for('.agreement_form', self.agreement, uuid=self.agreement.uuid))
     html = self.agreement.render(form)
     return WPAgreementForm.render_string(html, self._conf)
Exemplo n.º 2
0
 def _process(self):
     form = AgreementForm()
     if form.validate_on_submit() and self.agreement.pending:
         reason = form.reason.data if form.agreed.data else None
         func = self.agreement.accept if form.agreed.data else self.agreement.reject
         func(from_ip=request.remote_addr, reason=reason)
         if self.agreement.definition.event_settings.get(self._conf, 'manager_notifications_enabled'):
             notify_new_signature_to_manager(self.agreement)
         return redirect(url_for('.agreement_form', self.agreement, uuid=self.agreement.uuid))
     html = self.agreement.render(form)
     return WPAgreementForm.render_string(html, self._conf)
Exemplo n.º 3
0
 def _process(self):
     form = AgreementForm()
     if form.validate_on_submit() and self.agreement.pending:
         reason = form.reason.data if not form.agreed.data else None
         func = self.agreement.accept if form.agreed.data else self.agreement.reject
         func(from_ip=request.remote_addr, reason=reason)
         if self.agreement.definition.event_settings.get(self.event, 'manager_notifications_enabled'):
             notify_new_signature_to_manager(self.agreement)
         return redirect(url_for('.agreement_form', self.agreement, uuid=self.agreement.uuid))
     html = self.agreement.render(form)
     view_class = (WPAgreementFormConference
                   if self.event.type_ == EventType.conference else
                   WPAgreementFormSimpleEvent)
     return view_class.render_template('form_page.html', self.event, agreement=self.agreement, html=html)
Exemplo n.º 4
0
 def _process(self):
     form = AgreementForm()
     if form.validate_on_submit() and self.agreement.pending:
         reason = form.reason.data if not form.agreed.data else None
         func = self.agreement.accept if form.agreed.data else self.agreement.reject
         func(from_ip=request.remote_addr, reason=reason)
         if self.agreement.definition.event_settings.get(self.event, 'manager_notifications_enabled'):
             notify_new_signature_to_manager(self.agreement)
         return redirect(url_for('.agreement_form', self.agreement, uuid=self.agreement.uuid))
     html = self.agreement.render(form)
     view_class = (WPAgreementFormConference
                   if self.event.type_ == EventType.conference else
                   WPAgreementFormSimpleEvent)
     return view_class.render_template('form_page.html', self.event, agreement=self.agreement, html=html)