Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #217 from aldryn/fix/search-index-placeholder-getter
Browse files Browse the repository at this point in the history
update_seach_index: safe placeholder getter
  • Loading branch information
Chive committed May 29, 2015
2 parents 5d0f75d + 08d0425 commit 4fd163d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aldryn_newsblog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def update_seach_index(sender, instance, **kwargs):
perform simple searches even without Haystack, etc.
"""
if issubclass(instance.__class__, CMSPlugin):
placeholder = instance._placeholder_cache
placeholder = getattr(instance, '_placeholder_cache', None) or instance.placeholder
if hasattr(placeholder, '_attached_model_cache'):
if placeholder._attached_model_cache == Article:
article = placeholder._attached_model_cache.objects.get(
Expand Down

0 comments on commit 4fd163d

Please sign in to comment.