Remove the hard coded check for title and text when the comment form is submitted. This allows integrators to write schema extenders that remove the title from the comment form.

svn path=/plone.app.discussion/trunk/; revision=37341
This commit is contained in:
Timo Stollenwerk 2010-06-17 18:56:26 +00:00
parent 6e98edf54f
commit 12589d9fd2
2 changed files with 66 additions and 58 deletions

View File

@ -4,6 +4,11 @@ Changelog
1.0b5 (unreleased)
------------------
* Remove the hard coded check for title and text when the comment form is
submitted. This allows integrators to write schema extenders that remove the
title from the comment form.
[timo]
* Move captcha registration to its own captcha.zcml file.
[timo]

View File

@ -102,7 +102,10 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
def handleComment(self, action):
context = aq_inner(self.context)
wf = getToolByName(context, 'portal_workflow')
data, errors = self.extractData()
if errors:
return
title = u""
text = u""
@ -128,10 +131,10 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
else:
return
if 'title' in data and 'text' in data:
if 'title' in data:
title = data['title']
if 'text' in data:
text = data['text']
if 'author_name' in data:
author_name = data['author_name']
if 'author_username' in data: