Skip to content

Commit

Permalink
Merge branch 'hotfix/20230831_exception_invalid_pdd'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Sep 12, 2023
2 parents 2a20a89 + a2a310f commit d34d7f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions portality/view/doaj.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ def public_data_dump_redirect(record_type):
if not current_user.has_role(constants.ROLE_PUBLIC_DATA_DUMP):
abort(404)

target_data = models.Cache.get_public_data_dump().get(record_type, {})
if target_data is None:
# Make sure the PDD exists
pdd = models.Cache.get_public_data_dump()
if pdd is None:
abort(404)

target_data = pdd.get(record_type, {})
if not target_data:
abort(404)

main_store = store.StoreFactory.get(constants.STORE__SCOPE__PUBLIC_DATA_DUMP)
Expand Down

0 comments on commit d34d7f6

Please sign in to comment.