diff --git a/inspirehep/config.py b/inspirehep/config.py index 66a505ea0c..693f337e52 100644 --- a/inspirehep/config.py +++ b/inspirehep/config.py @@ -58,6 +58,7 @@ """This feature flag will prevent to send a ``replace`` update to legacy.""" FEATURE_FLAG_USE_ROOT_TABLE_ON_HEP = False FEATURE_FLAG_ENABLE_SNOW = False +FEATURE_FLAG_ENABLE_SAVE_WORFLOW_ON_DOWNLOAD_DOCUMENTS = True # Default language and timezone # ============================= BABEL_DEFAULT_LANGUAGE = 'en' diff --git a/inspirehep/modules/workflows/tasks/actions.py b/inspirehep/modules/workflows/tasks/actions.py index e39743b820..e9f7e03828 100644 --- a/inspirehep/modules/workflows/tasks/actions.py +++ b/inspirehep/modules/workflows/tasks/actions.py @@ -453,7 +453,8 @@ def download_documents(obj, eng): obj.log.error( 'Cannot download document from %s', url) delete_empty_key(obj, 'documents') - save_workflow(obj, eng) + if current_app.config['FEATURE_FLAG_ENABLE_SAVE_WORFLOW_ON_DOWNLOAD_DOCUMENTS']: + save_workflow(obj, eng) LOGGER.info('Documents downloaded: %s', len(obj.data.get('documents', [])))