diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-07-23 19:35:58 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-07-30 18:25:54 -0700 |
commit | 9b6903cd8385107ee354158031e92bc89f2be272 (patch) | |
tree | a1effe64afb608ae452fa597b0f330cbeb582a3d /python/fatcat_web/entity_helpers.py | |
parent | b0dd685479b6d92d5c85604180e710b13dfc88d8 (diff) | |
download | fatcat-9b6903cd8385107ee354158031e92bc89f2be272.tar.gz fatcat-9b6903cd8385107ee354158031e92bc89f2be272.zip |
web: move random article enrichment to special case
Instead of always enriching container entities with random articles,
only do so for the primary container view.
Diffstat (limited to 'python/fatcat_web/entity_helpers.py')
-rw-r--r-- | python/fatcat_web/entity_helpers.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py index e3d538e0..695ac426 100644 --- a/python/fatcat_web/entity_helpers.py +++ b/python/fatcat_web/entity_helpers.py @@ -3,7 +3,7 @@ from flask import abort from fatcat_openapi_client.rest import ApiException, ApiValueError from fatcat_tools.transforms import * from fatcat_web import app, api -from fatcat_web.search import get_elastic_container_stats, get_elastic_container_random_releases +from fatcat_web.search import get_elastic_container_stats from fatcat_web.hacks import strip_extlink_xml, wayback_suffix def enrich_container_entity(entity): @@ -14,9 +14,7 @@ def enrich_container_entity(entity): entity._stats = None try: entity._stats = get_elastic_container_stats(entity.ident, issnl=entity.issnl) - #if entity._stats['total'] > 0: - entity._random_releases = get_elastic_container_random_releases(entity.ident) - except Exception as e: + except ValueError as e: app.log.error(e) pass return entity |