示例#1
0
 def _process(self):
     delete_contribs = request.values.get('delete_contribs') == '1'
     deleted_contrib_count = 0
     for abstract in self.abstracts:
         if delete_contribs and abstract.contribution:
             deleted_contrib_count += 1
         delete_abstract(abstract, delete_contribs)
     deleted_abstract_count = len(self.abstracts)
     flash(ngettext("The abstract has been deleted.",
                    "{count} abstracts have been deleted.", deleted_abstract_count)
           .format(count=deleted_abstract_count), 'success')
     if deleted_contrib_count:
         flash(ngettext("The linked contribution has been deleted.",
                        "{count} linked contributions have been deleted.", deleted_contrib_count)
               .format(count=deleted_contrib_count), 'success')
     return jsonify_data(**self.list_generator.render_list())
示例#2
0
 def _process(self):
     delete_contribs = request.values.get('delete_contribs') == '1'
     deleted_contrib_count = 0
     for abstract in self.abstracts:
         if delete_contribs and abstract.contribution:
             deleted_contrib_count += 1
         delete_abstract(abstract, delete_contribs)
     deleted_abstract_count = len(self.abstracts)
     flash(ngettext("The abstract has been deleted.",
                    "{count} abstracts have been deleted.", deleted_abstract_count)
           .format(count=deleted_abstract_count), 'success')
     if deleted_contrib_count:
         flash(ngettext("The linked contribution has been deleted.",
                        "{count} linked contributions have been deleted.", deleted_contrib_count)
               .format(count=deleted_contrib_count), 'success')
     return jsonify_data(**self.list_generator.render_list())