Commit 9930e40b authored by Tatuya Kamada's avatar Tatuya Kamada

Bug #1724 : fix TALES calculations on Captcha Fields

Accessing self.values[property_id] skips all TALES/override computations, only
do it for properties that are set by the Captcha Provider.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34286 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ead87b6a
...@@ -312,14 +312,16 @@ class CaptchaField(ZMIField): ...@@ -312,14 +312,16 @@ class CaptchaField(ZMIField):
security.declareProtected('Access contents information', 'get_value') security.declareProtected('Access contents information', 'get_value')
def get_value(self, id, **kw): def get_value(self, id, **kw):
if self.values.has_key(id): if id in self.getCaptchaCustomPropertyList():
return self.values[id] return self.values[id]
return ZMIField.get_value(self, id, **kw) return ZMIField.get_value(self, id, **kw)
def getCaptchaCustomPropertyList(self): def getCaptchaCustomPropertyList(self):
captcha_type = self.get_value("captcha_type") if hasattr(self, "__extraPropertyList"):
return self.__extraPropertyList
captcha_type = ZMIField.get_value(self, "captcha_type")
captcha_provider = CaptchaProviderFactory.getProvider(captcha_type) captcha_provider = CaptchaProviderFactory.getProvider(captcha_type)
extraPropertyList = captcha_provider.getExtraPropertyList() extraPropertyList = captcha_provider.getExtraPropertyList()
self.__extraPropertyList = [x.id for x in extraPropertyList] self.__extraPropertyList = [x.id for x in extraPropertyList]
return extraPropertyList return extraPropertyList
\ 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