*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 9dd6215c authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Fix access to property of FileInstance set to None

* soft-deleted files will have ObjectVersions that don't have an
  associated FileInstance
parent 44e6c843
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,10 @@ def get_orphaned_files(location):
# filter out those files that invenio has knowledge about
for bucket in location.buckets:
for obj in bucket.objects:
all_files.remove(obj.file.uri)
if obj.file:
# an object_version without attached file_instance
# likely denotes a soft-deleted file
all_files.remove(obj.file.uri)
return all_files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment