Пример #1
0
 def _process(self):
     form = SubContributionForm(event=self.event)
     if form.validate_on_submit():
         subcontrib = create_subcontribution(self.contrib, form.data)
         flash(_("Subcontribution '{}' created successfully").format(subcontrib.title), 'success')
         return jsonify_data(html=_render_subcontribution_list(self.contrib))
     return jsonify_template('events/contributions/forms/subcontribution.html', form=form)
Пример #2
0
 def _process_POST(self):
     form = SubContributionForm(event=self.event)
     if form.validate_on_submit():
         subcontrib = create_subcontribution(self.contrib, form.data)
         return jsonify(id=subcontrib.id,
                        contribution_id=subcontrib.contribution_id,
                        event_id=self.event.id)
     return jsonify_data(success=False, errors=form.errors), 400
Пример #3
0
 def _process_POST(self):
     form = SubContributionForm(event=self.event)
     if form.validate_on_submit():
         subcontrib = create_subcontribution(self.contrib, form.data)
         return jsonify(id=subcontrib.id, contribution_id=subcontrib.contribution_id, event_id=self.event.id)
     return jsonify_data(success=False, errors=form.errors), 400