[CMF-checkins] CVS: Products/CMFDefault - MetadataTool.py:1.20.20.2
Jens Vagelpohl
jens at dataflake.org
Sat Aug 7 09:31:28 EDT 2004
Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv18095/CMFDefault
Modified Files:
Tag: CMF-1_4-branch
MetadataTool.py
Log Message:
- CMFDefault.MetadataTool: Validation would disallow
vocabulary-constrained metadata elements to be empty
(http://www.zope.org/Collectors/CMF/217)
=== Products/CMFDefault/MetadataTool.py 1.20.20.1 => 1.20.20.2 ===
--- Products/CMFDefault/MetadataTool.py:1.20.20.1 Thu Apr 22 13:47:50 2004
+++ Products/CMFDefault/MetadataTool.py Sat Aug 7 09:31:28 2004
@@ -535,12 +535,12 @@
raise MetadataError, \
'Metadata element %s is required.' % element
- if policy.enforceVocabulary():
+ if value and policy.enforceVocabulary():
values = policy.isMultiValued() and value or [ value ]
for value in values:
if not value in policy.allowedVocabulary():
raise MetadataError, \
- 'Value %s is not in allowed vocabulary for' \
+ 'Value %s is not in allowed vocabulary for ' \
'metadata element %s.' % ( value, element )
# TODO: Call validation_hook, if present
More information about the CMF-checkins
mailing list