[CMF-checkins] CVS: Products/CMFDefault - MetadataTool.py:1.25
Jens Vagelpohl
jens at dataflake.org
Sat Aug 7 09:30:50 EDT 2004
Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv17874/CMFDefault
Modified Files:
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.24 => 1.25 ===
--- Products/CMFDefault/MetadataTool.py:1.24 Tue Jul 20 02:11:38 2004
+++ Products/CMFDefault/MetadataTool.py Sat Aug 7 09:30:50 2004
@@ -536,12 +536,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