From 39d2760ab9640d8d2c29ac50470f2af29c12f3c3 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 29 Sep 2019 08:40:19 +0100 Subject: [PATCH] Handle case where description is missing from LD. --- depicts/saam.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/depicts/saam.py b/depicts/saam.py index 673539c..16dc48a 100644 --- a/depicts/saam.py +++ b/depicts/saam.py @@ -27,10 +27,12 @@ def parse_html(html): def get_catalog(saam_id): data = parse_html(get_html(saam_id)) - return { + ret = { 'institution': 'Smithsonian American Art Museum', 'keywords': data['keywords'], - 'description': data['ld']['description'] } + if 'description' in data['ld']: + ret['description'] = data['ld']['description'] + return ret