Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Bug: Do not fail if we cannot delete the parent and name attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
strichter committed Feb 8, 2013
1 parent 7aaf227 commit 609b2d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 5 additions & 5 deletions CHANGES.txt
Expand Up @@ -5,22 +5,22 @@ CHANGES
0.7.7 (unreleased)
------------------

- Nothing changed yet.
- Bug: Do not fail if we cannot delete the parent and name attributes.


0.7.6 (2013-02-08)
------------------

- Switch to pymongo.MongoClient, set default write concern values,
allow override of write concern values
- Feature: Switch to ``pymongo.MongoClient``, set default write concern values,
allow override of write concern values.


0.7.5 (2013-02-06)
------------------

- Added, cleaned tests
- Tests: Added, cleaned tests

- Re-release after missing files in 0.7.4
- Bug: Re-release after missing files in 0.7.4

0.7.4 (2013-02-05)
------------------
Expand Down
12 changes: 10 additions & 2 deletions src/mongopersist/zope/container.py
Expand Up @@ -217,9 +217,17 @@ def __delitem__(self, key):
value = self[key]
# First remove the parent and name from the object.
if self._m_mapping_key is not None:
delattr(value, self._m_mapping_key)
try:
delattr(value, self._m_mapping_key)
except AttributeError, err:
# Sometimes we do not control those attributes.
pass
if self._m_parent_key is not None:
delattr(value, self._m_parent_key)
try:
delattr(value, self._m_parent_key)
except AttributeError, err:
# Sometimes we do not control those attributes.
pass
# Let's now remove the object from the database.
if self._m_remove_documents:
self._m_jar.remove(value)
Expand Down

0 comments on commit 609b2d0

Please sign in to comment.