diff --git a/portality/bll/services/journal.py b/portality/bll/services/journal.py index cd8bc766b0..fdad582080 100644 --- a/portality/bll/services/journal.py +++ b/portality/bll/services/journal.py @@ -10,6 +10,7 @@ from portality.lib.dates import FMT_DATETIME_SHORT from portality.store import StoreFactory, prune_container, StoreException from portality.crosswalks.journal_questions import Journal2QuestionXwalk +from portality.util import no_op from datetime import datetime, timedelta import re, csv, random, string @@ -131,6 +132,10 @@ def csv(self, prune=True, logger=None): {"arg": logger, "allow_none": True, "arg_name": "logger"} ], exceptions.ArgumentException) + # None isn't executable, so convert logger to NO-OP + if logger is None: + logger = no_op + # ~~->FileStoreTemp:Feature~~ filename = 'journalcsv__doaj_' + dates.now_str(FMT_DATETIME_SHORT) + '_utf8.csv' container_id = app.config.get("STORE_CACHE_CONTAINER") diff --git a/portality/util.py b/portality/util.py index 84423e1b91..2a4e1f36f3 100644 --- a/portality/util.py +++ b/portality/util.py @@ -186,3 +186,7 @@ def get_full_url_safe(endpoint): except werkzeug.routing.BuildError: app.logger.warning(f'endpoint not found -- [{endpoint}]') return None + +def no_op(*args, **kwargs): + """ noop (no operation) function """ + pass \ No newline at end of file