Esempio n. 1
0
 def delete(self, id):
     entity = self.model.query.get_or_404(id)
     if self.user_can_change:
         can_delete_object(entity)
     else:
         if not current_user.has_role('superuser'):
             abort(403, 'Access denied')
     self.before_delete(entity)
     db.session.delete(entity)
     db.session.commit()
     return jsonify(id=id, success=True)
Esempio n. 2
0
 def delete(self, id):
     entity = self.model.query.get_or_404(id)
     if self.user_can_change:
         can_delete_object(entity)
     else:
         if not current_user.has_role('superuser'):
             abort(403, 'Access denied')
     self.before_delete(entity)
     db.session.delete(entity)
     db.session.commit()
     return jsonify(id=id, success=True)
Esempio n. 3
0
def merge_ebooks(ebook, other):
    can_delete_object(other)
    logic.merge_ebooks(ebook, other)
Esempio n. 4
0
 def delete(self, id):
     conv = model.ConversionBatch.query.get_or_404(id)
     can_delete_object(conv)
     logic.delete_conversion_batch(conv)
     return jsonify(id=id, success=True)
Esempio n. 5
0
 def delete(self, id):
     source = model.Source.query.get_or_404(id)
     can_delete_object(source)
     logic.delete_source(source)
     return jsonify(id=id, success=True)
Esempio n. 6
0
def merge_ebooks(ebook, other):
    can_delete_object(other)
    logic.merge_ebooks(ebook, other)
Esempio n. 7
0
 def delete(self, id):
     conv= model.ConversionBatch.query.get_or_404(id)
     can_delete_object(conv)
     logic.delete_conversion_batch(conv)
     return jsonify(id=id, success=True)
Esempio n. 8
0
 def delete(self,id):
     source= model.Source.query.get_or_404(id)
     can_delete_object(source)
     logic.delete_source(source)
     return jsonify(id=id, success=True)