don't send messages too short (refs #307)
This commit is contained in:
parent
d3feefbe1f
commit
92d4bd2e73
1 changed files with 6 additions and 2 deletions
|
|
@ -231,10 +231,14 @@ class ContactThreadPage(PageBase):
|
|||
"""
|
||||
|
||||
def post(self, content):
|
||||
if isinstance(content, unicode):
|
||||
content = content.encode('iso-8859-15', 'replace')
|
||||
|
||||
if len(content) < 3:
|
||||
raise AdopteCantPostMail("Your message is too short (minimum 3 chars)")
|
||||
|
||||
try:
|
||||
self.browser.select_form(name="sendMsg")
|
||||
if isinstance(content, unicode):
|
||||
content = content.encode('iso-8859-15', 'replace')
|
||||
self.browser['message'] = content
|
||||
|
||||
self.browser.submit() # submit current form
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue