Commit 9fd0cdc3 authored by Xiaowu Zhang's avatar Xiaowu Zhang

product/ERP5Form/HoneypotField: change message name

parent c7334713
......@@ -29,15 +29,15 @@ class HoneypotValidator(Validator.Validator):
"""
property_names = Validator.Validator.property_names
message_names = Validator.Validator.message_names + ['no_validator']
no_validator = 'A bot may try to submit.'
message_names = Validator.Validator.message_names + ['bot_submit']
bot_submit = 'A bot may try to submit.'
def validate(self, field, key, REQUEST):
value = REQUEST.get(key, None)
default_value = field.get_value('default')
if value is None or value != default_value:
#this field is not sent or sent with value added by bot
self.raise_error('no_validator', field)
self.raise_error('bot_submit', field)
return default_value
HoneypotValidatorInstance = HoneypotValidator()
......
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