def METHOD_NAME(event_id):
    query = DiscountCode.query.filter_by(event_id=event_id, orders=None)
    result = query.delete(synchronize_session=False)
    db.session.commit()
    return jsonify({'success': True, 'deletes': result})