[Erp5-report] r42324 nicolas.dumazet - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 14 06:39:59 CET 2011


Author: nicolas.dumazet
Date: Fri Jan 14 06:39:59 2011
New Revision: 42324

URL: http://svn.erp5.org?rev=42324&view=rev
Log:
do not crash if the object has no parent because it's unwrapped

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=42324&r1=42323&r2=42324&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Base.py [utf8] Fri Jan 14 06:39:59 2011
@@ -3883,7 +3883,11 @@ class Base( CopyContainer,
       self._p_changed = True
       # this might look useless, but it is necessary to explicitely record
       # the change in the parent container, because the class has changed
-      setattr(self.getParentValue(), self.getId(), self)
+      try:
+        parent = self.getParentValue()
+      except AttributeError:
+        return
+      setattr(parent, self.getId(), self)
 
   security.declareProtected(Permissions.DeletePortalContent,
                             'migratePortalType')



More information about the Erp5-report mailing list