Handling missing rel attr.

This commit is contained in:
Samuel Clay 2016-08-15 14:58:38 -07:00
parent 327f46d2b6
commit 43b90a6ab3

View file

@ -136,7 +136,7 @@ def pre_process_story(entry, encoding):
elif 'image' in media_type and media_url:
entry['story_content'] += """<br><br><img src="%s" />""" % 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