Skip to content

Commit

Permalink
Merge pull request #1640 from spacetelescope/develop
Browse files Browse the repository at this point in the history
Update to pre-release 1.2.11
  • Loading branch information
mfixstsci authored Aug 26, 2024
2 parents 216cf5e + 7b42de7 commit 0840979
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,8 +1720,13 @@ def get_proposal_info(filepaths):
for fname in files_for_proposal:
file_info = filename_parser(fname)
if file_info['recognized_filename']:
obs = file_info['observation']
obsnums.append(obs)
# Wrap in a try/except because level 3 files do not have an 'observation' key.
# That's ok. We will ignore those files.
try:
obs = file_info['observation']
obsnums.append(obs)
except KeyError:
pass
else:
logging.warning((f'While running get_proposal_info() for a program {proposal}, {fname} '
'was not recognized by the filename_parser().'))
Expand Down Expand Up @@ -2163,7 +2168,10 @@ def thumbnails_ajax(inst, proposal, obs_num=None):
# in those files anyway.
file_info = filename_parser(root)
if file_info['recognized_filename']:
all_obs.append(file_info['observation'])
try:
all_obs.append(file_info['observation'])
except KeyError:
pass
else:
logging.warning((f'While running thumbnails_ajax() on root {root}, '
'filename_parser() failed to recognize the file pattern.'))
Expand Down

0 comments on commit 0840979

Please sign in to comment.