Skip to content

Commit

Permalink
Merge tag '2023-10-17_add_noop' into develop
Browse files Browse the repository at this point in the history
Dummy function to add no-op
  • Loading branch information
Steven-Eardley committed Oct 19, 2023
2 parents b847f88 + e86c20d commit 579be8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions portality/bll/services/journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions portality/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 579be8a

Please sign in to comment.