'Mark this job as deleted, and mark any output datasets as discarded.'

def mark_deleted(self, track_jobs_in_database=False):

    if self.finished:
        return
    if track_jobs_in_database:
        self.state = Job.states.DELETED_NEW
    else:
        self.state = Job.states.DELETED
    self.info = 'Job    output    deleted    by    user    before    job    completed.'
    for dataset_assoc in self.output_datasets:
        dataset = dataset_assoc.dataset
        dataset.deleted = True
        dataset.state = dataset.states.DISCARDED
        for dataset in dataset.dataset.history_associations:
            dataset.deleted = True
            dataset.blurb = 'deleted'
            dataset.peek = 'Job    deleted'
            dataset.info = 'Job    output    deleted    by    user    before    job    completed'
