def coupon_bulk_delete(): form = BulkDeleteForm() if form.validate_on_submit(): ids = Coupon.get_bulk_action_ids(request.form.get('scope'), request.form.getlist('bulk_id'), query=request.args.get('q', '')) Coupon.bulk_delete(ids) flash('{0} coupon(s) will be deleted.'.format(len(ids)), 'succes') else: flash('No coupon were deleted, something went wrong', 'error') return redirect(url_for('admin.coupon'))
def delete_coupons(ids): """ Delete coupons both on the payment gateway and locally. :param ids: List of ids to be deleted :type ids: list :return: int """ return Coupon.bulk_delete(ids)
def delete_coupons(ids): """ Delete coupons on the payment gateway and locally. :param ids: List of ids to be deleted. :return: Bulk delete coupons. """ return Coupon.bulk_delete(ids)