Hello,
I am trying to run the cleanup scripts on my local installation but get stuck when trying to run the following:

./scripts/cleanup_datasets/cleanup_datasets.py universe_wsgi.ini -d 10 -5 -r

Deleting library dataset id  7225
Traceback (most recent call last):
  File "./scripts/cleanup_datasets/cleanup_datasets.py", line 524, in <module>
    if __name__ == "__main__": main()
  File "./scripts/cleanup_datasets/cleanup_datasets.py", line 124, in main
    purge_folders( app, cutoff_time, options.remove_from_disk, info_only = options.info_only, force_retry = options.force_retry )
  File "./scripts/cleanup_datasets/cleanup_datasets.py", line 247, in purge_folders
    _purge_folder( folder, app, remove_from_disk, info_only = info_only )
  File "./scripts/cleanup_datasets/cleanup_datasets.py", line 497, in _purge_folder
    _purge_folder( sub_folder, app, remove_from_disk, info_only = info_only )
  File "./scripts/cleanup_datasets/cleanup_datasets.py", line 497, in _purge_folder
    _purge_folder( sub_folder, app, remove_from_disk, info_only = info_only )
  File "./scripts/cleanup_datasets/cleanup_datasets.py", line 495, in _purge_folder
    _purge_dataset_instance( ldda, app, remove_from_disk, info_only = info_only ) #mark a DatasetInstance as deleted, clear associated files, and mark the Dataset as deleted if it is deletable
  File "./scripts/cleanup_datasets/cleanup_datasets.py", line 376, in _purge_dataset_instance
    ( dataset_instance.__class__.__name__, dataset_instance.id, dataset_instance.dataset.id )
AttributeError: 'NoneType' object has no attribute 'id'


Any help would be much appreciated.

Thanks,
Liisa