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)
def merge_ebooks(ebook, other): can_delete_object(other) logic.merge_ebooks(ebook, other)
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)
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)
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)
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)