# HG changeset patch # User Thierry Florac # Date 1537805391 -7200 # Node ID 3d68a46a7cdeec41526f3dce5589d044d3deb3f0 # Parent 11ddf4a11ff3b87695bb9038b7d628198f9cc0a6 Updated gallery paragraph index info diff -r 11ddf4a11ff3 -r 3d68a46a7cde src/pyams_content_es/component/paragraph.py --- a/src/pyams_content_es/component/paragraph.py Wed Sep 19 11:19:11 2018 +0200 +++ b/src/pyams_content_es/component/paragraph.py Mon Sep 24 18:09:51 2018 +0200 @@ -14,8 +14,7 @@ from pyams_content.component.gallery.interfaces import IGalleryParagraph from pyams_content.component.illustration.interfaces import IIllustrationParagraph -from pyams_content.component.paragraph.interfaces import IParagraphContainer, IParagraphContainerTarget, \ - IBaseParagraph +from pyams_content.component.paragraph.interfaces import IBaseParagraph, IParagraphContainer, IParagraphContainerTarget from pyams_content.component.paragraph.interfaces.audio import IAudioParagraph from pyams_content.component.paragraph.interfaces.contact import IContactParagraph from pyams_content.component.paragraph.interfaces.frame import IFrameParagraph @@ -100,11 +99,8 @@ def gallery_paragraph_index_info(paragraph): """Gallery paragraph index info""" info = {} - for lang, title in (getattr(paragraph, 'title', {}) or {}).items(): - if title: - info.setdefault(lang, title) for image in IGalleryParagraph(paragraph).values(): - for attr in ('title', 'alt_title', 'description', 'author_comments', 'sound_title', 'sound_description'): + for attr in ('title', 'alt_title', 'description', 'sound_title', 'sound_description'): for lang, value in (getattr(image, attr, {}) or {}).items(): if value: new_info = '{old}\n{value}'.format(old=info.get(lang, ''),