changeset 1133:122dd136d1ab

pages (blog/view): allow commenting when profile is connected
author Goffi <goffi@goffi.org>
date Wed, 03 Oct 2018 20:46:44 +0200
parents 0cafb79ced6d
children 28789926852a
files libervia/pages/blog/view/page_meta.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/pages/blog/view/page_meta.py	Tue Sep 18 21:16:53 2018 +0200
+++ b/libervia/pages/blog/view/page_meta.py	Wed Oct 03 20:46:44 2018 +0200
@@ -154,6 +154,9 @@
     profile = self.getProfile(request)
     if profile is None:
         profile = C.SERVICE_PROFILE
+        profile_connected = False
+    else:
+        profile_connected = True
 
     ## pagination/filtering parameters
     params = self.getAllPostedData(request, multiple=False)
@@ -203,7 +206,7 @@
             template_data['older_url'] = self.getParamURL(request, after=last_id)
 
     ## identities ##
-    # identities are use to show nice nickname or avatars
+    # identities are used to show nice nickname or avatars
     identities = template_data[u'identities'] = self.host.getSessionData(request, session_iface.ISATSession).identities
 
     ## Comments ##
@@ -265,7 +268,7 @@
                 tags_http_uri[tag] = self.host.getExtBaseURL(request, tag_url)
 
     # if True, page should display a comment box
-    template_data[u'allow_commenting'] = data.get(u'allow_commenting', False)
+    template_data[u'allow_commenting'] = data.get(u'allow_commenting', profile_connected)
 
     # last but not least, we add a xmpp: link to the node
     uri_args = {u'path': service.full()}