feincms/feincms-elephantblog — Issue #6: Error when not using FeinCMS's medialibrary
Author: cjflory
Created: 2012-02-12 05:08:06+00:00
State: open

The **utils.py** file has an error, when not using FeinCMS's medialibrary. One way to solve this, is to add try/except.

try:
for content in Entry.mediafilecontent_set.related.model.objects.filter(
parent__in=entry_dict.keys(),
mediafile__type='image').reverse().select_related('mediafile'):
entry_dict[content.parent_id].first_image = content
except AttributeError:
pass