diff --git a/pillar/api/eve_settings.py b/pillar/api/eve_settings.py index a475856a..b7c54cf6 100644 --- a/pillar/api/eve_settings.py +++ b/pillar/api/eve_settings.py @@ -720,11 +720,12 @@ tokens = { } files = { + 'schema': files_schema, 'resource_methods': ['GET', 'POST'], 'item_methods': ['GET', 'PATCH'], 'public_methods': ['GET'], 'public_item_methods': ['GET'], - 'schema': files_schema + 'soft_delete': True, } groups = { diff --git a/pillar/cli/maintenance.py b/pillar/cli/maintenance.py index 32edec24..dc4671a5 100644 --- a/pillar/cli/maintenance.py +++ b/pillar/cli/maintenance.py @@ -544,7 +544,8 @@ def _find_orphan_files(project_id: bson.ObjectId) -> typing.Set[bson.ObjectId]: # Get all file IDs that belong to this project. files_coll = current_app.db('files') - cursor = files_coll.find({'project': project_id}, projection={'_id': 1}) + file_filter = {'project': project_id, '_deleted': {'$ne': True}} + cursor = files_coll.find(file_filter, projection={'_id': 1}) file_ids = {doc['_id'] for doc in cursor} if not file_ids: log.debug('Project %s has no files', project_id)