From: Matthew W. <svn...@pl...> - 2009-07-20 12:31:38
|
Author: matthewwilkes Date: Mon Jul 20 12:31:29 2009 New Revision: 28115 Modified: plone.app.dexterity/trunk/plone/app/dexterity/behaviors/metadata.py plone.app.dexterity/trunk/plone/app/dexterity/tests/metadata.txt Log: Fix for issue demonstrated by r28114. Calls addCreator on DefaultDublinCoreImpl to add the initial user as a creator. Also fixes error in test, the functional tests here log you in as root, not test_user_1_. Modified: plone.app.dexterity/trunk/plone/app/dexterity/behaviors/metadata.py ============================================================================== --- plone.app.dexterity/trunk/plone/app/dexterity/behaviors/metadata.py (original) +++ plone.app.dexterity/trunk/plone/app/dexterity/behaviors/metadata.py Mon Jul 20 12:31:29 2009 @@ -196,5 +196,9 @@ contributors = DCFieldProperty(IOwnership['contributors'], get_name = 'Contributors', set_name = 'setContributors') rights = DCFieldProperty(IOwnership['rights'], get_name = 'Rights', set_name = 'setRights') + def __init__(self, *args, **kwargs): + super(Ownership, self).__init__(*args, **kwargs) + self.context.addCreator() + class DublinCore(Basic, Categorization, Publication, Ownership): pass Modified: plone.app.dexterity/trunk/plone/app/dexterity/tests/metadata.txt ============================================================================== --- plone.app.dexterity/trunk/plone/app/dexterity/tests/metadata.txt (original) +++ plone.app.dexterity/trunk/plone/app/dexterity/tests/metadata.txt Mon Jul 20 12:31:29 2009 @@ -42,7 +42,7 @@ True >>> md = self.portal.metadatad_type >>> md.Creator() - 'test_user_1_' + 'root' The modified and creation dates are set correctly:: |