Commit 9703cacb authored by Ivan Tyagov's avatar Ivan Tyagov

If no threads are found this means no posts exists and no need to create a SQL...

If no threads are found this means no posts exists and no need to create a SQL query with empty parents (which would return all posts regardless if the belong to web section or not).
parent e00e1266
......@@ -61,6 +61,10 @@ kw[\'sort_on\'] = ((\'modification_date\', \'DESC\'),)\n
kw[\'portal_type\'] = \'Discussion Post\'\n
kw[\'parent_uid\'] = parent_uid_list\n
\n
if len(parent_uid_list)==0:\n
# no parent discussion threads therefore no posts\n
return []\n
\n
result = [x.getObject() for x in context.portal_catalog(**kw)]\n
return result\n
</string> </value>
......
130
\ No newline at end of file
131
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment