Esempio n. 1
0
 def _process(self):
     form = self._get_form()
     if form.validate_on_submit():
         self._success_handler(form)
         return jsonify(success=True)
     return WPJinjaMixin.render_template(self.dialog_template, event=self.event, form=form,
                                         definition=self.definition)
Esempio n. 2
0
 def _process(self):
     form = self._get_form()
     if form.validate_on_submit():
         self._success_handler(form)
         return jsonify(success=True)
     return WPJinjaMixin.render_template(self.dialog_template, event=self.event, form=form,
                                         definition=self.definition)
Esempio n. 3
0
 def _process(self):
     agreement = self.agreement
     form = AgreementAnswerSubmissionForm()
     if form.validate_on_submit():
         if agreement is None:
             agreement = Agreement.create_from_data(
                 event=self.event,
                 type_=self.definition.name,
                 person=self.person)
             db.session.add(agreement)
             db.session.flush()
         if form.answer.data:
             agreement.accept(from_ip=request.remote_addr, on_behalf=True)
             agreement.attachment_filename = form.document.data.filename
             agreement.attachment = form.document.data.read()
         else:
             agreement.reject(from_ip=request.remote_addr, on_behalf=True)
         flash(
             _('Agreement answered on behalf of {0}').format(
                 agreement.person_name), 'success')
         return jsonify(success=True)
     return WPJinjaMixin.render_template(
         'events/agreements/dialogs/agreement_submit_answer_form.html',
         form=form,
         event=self.event,
         agreement=agreement)
Esempio n. 4
0
 def _process(self):
     agreement = self.agreement
     form = AgreementAnswerSubmissionForm()
     if form.validate_on_submit():
         if agreement is None:
             agreement = Agreement.create_from_data(event=self.event, type_=self.definition.name,
                                                    person=self.person)
             db.session.add(agreement)
             db.session.flush()
         if form.answer.data:
             agreement.accept(from_ip=request.remote_addr, on_behalf=True)
             agreement.attachment_filename = form.document.data.filename
             agreement.attachment = form.document.data.read()
         else:
             agreement.reject(from_ip=request.remote_addr, on_behalf=True)
         flash(_("Agreement answered on behalf of {0}".format(agreement.person_name)), 'success')
         return jsonify(success=True)
     return WPJinjaMixin.render_template('events/agreements/dialogs/agreement_submit_answer_form.html', form=form,
                                         event=self.event, agreement=agreement)
Esempio n. 5
0
 def _getBody(self, params):
     return WPJinjaMixin._getPageContent(self, params)
Esempio n. 6
0
 def _get_body(self, params):
     return WPJinjaMixin._get_page_content(self, params)
Esempio n. 7
0
 def _getBody(self, params):
     return WPJinjaMixin._getPageContent(self, params)
Esempio n. 8
0
 def _get_body(self, params):
     return WPJinjaMixin._get_page_content(self, params)
Esempio n. 9
0
 def _getBody(self, params):
     return WPJinjaMixin._getPageContent(self, params).encode('utf-8')