Always display selected renderer
authorThierry Florac <tflorac@ulthar.net>
Fri, 04 Oct 2019 19:13:14 +0200
changeset 269 ecbd099f2627
parent 268 b7d59c0b94f5
child 270 93cc93070878
Always display selected renderer
src/pyams_portal/portlet.py
--- a/src/pyams_portal/portlet.py	Thu Sep 26 11:56:07 2019 +0200
+++ b/src/pyams_portal/portlet.py	Fri Oct 04 19:13:14 2019 +0200
@@ -174,12 +174,10 @@
             return render('templates/portlet-hidden.pt', {}, request=self.request)
         else:
             result = super(PortletPreviewer, self).render()
-            settings = self.settings
-            if settings.renderer:
-                renderer = settings.get_renderer()
-                translate = self.request.localizer.translate
-                result = PREVIEW_PREFIX.format(label=translate(_("Renderer:")),
-                                               renderer=translate(renderer.label)) + result
+            renderer = self.settings.get_renderer()
+            translate = self.request.localizer.translate
+            result = PREVIEW_PREFIX.format(label=translate(_("Renderer:")),
+                                           renderer=translate(renderer.label)) + result
             return result