diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-02-19 17:32:27 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-02-19 17:32:27 -0800 |
commit | f6ef597e3fb9b6f89dc054960725a2cfb7ded851 (patch) | |
tree | 622d225509d94bf3a76c1fd731d5a874e9a23cc0 /python/fatcat_web/entity_helpers.py | |
parent | 64d3c5475921a8024b083558ca96bb15e27f48c1 (diff) | |
parent | 016d6d28c24f616897bdb7587205cfe2cc32ec89 (diff) | |
download | fatcat-f6ef597e3fb9b6f89dc054960725a2cfb7ded851.tar.gz fatcat-f6ef597e3fb9b6f89dc054960725a2cfb7ded851.zip |
Merge branch 'bnewbold-shadow-import'
Diffstat (limited to 'python/fatcat_web/entity_helpers.py')
-rw-r--r-- | python/fatcat_web/entity_helpers.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py index af0fea83..591dda80 100644 --- a/python/fatcat_web/entity_helpers.py +++ b/python/fatcat_web/entity_helpers.py @@ -53,6 +53,10 @@ def enrich_release_entity(entity): entity._es = release_to_elasticsearch(entity, force_bool=False) if entity.container and entity.container.state == "active": entity.container._es = container_to_elasticsearch(entity.container, force_bool=False) + if entity.files: + # remove shadows-only files with no URLs + entity.files = [f for f in entity.files + if not (f.extra and f.extra.get('shadows') and not f.urls)] if entity.filesets: for fs in entity.filesets: fs._total_size = sum([f.size for f in fs.manifest]) |