From 43b90a6ab31f3c9e78640a3776cc8410746610f4 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 15 Aug 2016 14:58:38 -0700 Subject: [PATCH] Handling missing rel attr. --- utils/story_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/story_functions.py b/utils/story_functions.py index 0ecc2baed..269f8d1e5 100644 --- a/utils/story_functions.py +++ b/utils/story_functions.py @@ -136,7 +136,7 @@ def pre_process_story(entry, encoding): elif 'image' in media_type and media_url: entry['story_content'] += """

""" % media_url continue - elif media_content.get('rel') == 'alternative' or 'text' in media_content.get('type'): + elif media_content.get('rel', '') == 'alternative' or 'text' in media_content.get('type', ''): continue elif media_type_name in ['application']: continue