[Checkins] SVN: Products.PluggableAuthService/trunk/ Modify ZODBGroupManager to update group title and description independently, thanks to Eric and Erik from Penn State for the patch.

Hanno Schlichting hannosch at hannosch.eu
Tue Jan 12 14:31:24 EST 2010


Log message for revision 108078:
  Modify ZODBGroupManager to update group title and description independently, thanks to Eric and Erik from Penn State for the patch.
  

Changed:
  U   Products.PluggableAuthService/trunk/CHANGES.txt
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/version.txt

-=-
Modified: Products.PluggableAuthService/trunk/CHANGES.txt
===================================================================
--- Products.PluggableAuthService/trunk/CHANGES.txt	2010-01-12 17:33:51 UTC (rev 108077)
+++ Products.PluggableAuthService/trunk/CHANGES.txt	2010-01-12 19:31:24 UTC (rev 108078)
@@ -1,6 +1,12 @@
 Change Log
 ==========
 
+
+1.7.0b2 (Unreleased)
+--------------------
+
+- Modify ZODBGroupManager to update group title and description independently.
+
 1.7.0b1 (2009-11-16)
 --------------------
 

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py	2010-01-12 17:33:51 UTC (rev 108077)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBGroupManager.py	2010-01-12 19:31:24 UTC (rev 108078)
@@ -186,16 +186,17 @@
                                    }
 
     security.declarePrivate( 'updateGroup' )
-    def updateGroup( self, group_id, title, description ):
+    def updateGroup( self, group_id, title=None, description=None ):
 
         """ Update properties for 'group_id'
 
         o Raise KeyError if group_id doesn't already exist.
         """
-        self._groups[ group_id ].update({ 'title' : title
-                                        , 'description' : description
-                                        })
-        self._groups[ group_id ] = self._groups[ group_id ]
+        if title is not None:
+            self._groups[group_id]['title'] = title
+        if description is not None:
+            self._groups[group_id]['description'] = description
+        self._groups[group_id] = self._groups[group_id]
 
     security.declarePrivate( 'removeGroup' )
     def removeGroup( self, group_id ):

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py	2010-01-12 17:33:51 UTC (rev 108077)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py	2010-01-12 19:31:24 UTC (rev 108078)
@@ -95,6 +95,19 @@
         group_info = zgm.getGroupInfo( 'group' )
         self.assertEqual( group_info['title'], 'group_title_changed' )
 
+    def test_updateGroup_independent(self):
+        zgm = self._makeOne()
+
+        zgm.addGroup( 'group', 'group_title', 'group_desc' )
+
+        zgm.updateGroup( 'group', title='group_title_changed_again')
+        group_info = zgm.getGroupInfo( 'group' )
+        self.assertEqual( group_info['description'], 'group_desc' )
+        zgm.updateGroup( 'group', description='group_description_changed_again')
+        group_info = zgm.getGroupInfo( 'group' )
+        self.assertEqual( group_info['title'], 'group_title_changed_again' )
+        
+
     def test_addPrincipalToGroup( self ):
         zgm = self._makeOne()
 

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/version.txt
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/version.txt	2010-01-12 17:33:51 UTC (rev 108077)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/version.txt	2010-01-12 19:31:24 UTC (rev 108078)
@@ -1 +1 @@
-1.7.0b1
+1.7.0b2



More information about the checkins mailing list