diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2013-05-07 19:21:08 -0700 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2013-05-07 19:21:08 -0700 |
| commit | aa7d79d2ad119e575d8cd14f19369e74b22f804b (patch) | |
| tree | 026b326288666c650ab9db85d097b2ae42581791 /budget/models.py | |
| parent | 396a91e1ac6f65b88cc25ac208b606b0ebe79b9c (diff) | |
| parent | 4d329a76aeb9ca06895c4293e653aa38dbeab2c5 (diff) | |
| download | ihatemoney-mirror-aa7d79d2ad119e575d8cd14f19369e74b22f804b.zip ihatemoney-mirror-aa7d79d2ad119e575d8cd14f19369e74b22f804b.tar.gz ihatemoney-mirror-aa7d79d2ad119e575d8cd14f19369e74b22f804b.tar.bz2 | |
Merge pull request #101 from aavenel/bugfix92
Bugfix#92 : error when deleting an user
Diffstat (limited to 'budget/models.py')
| -rw-r--r-- | budget/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/budget/models.py b/budget/models.py index 586f43b..db57869 100644 --- a/budget/models.py +++ b/budget/models.py @@ -70,7 +70,10 @@ class Project(db.Model): This method returns the status DELETED or DEACTIVATED regarding the changes made. """ - person = Person.query.get(member_id, self) + try: + person = Person.query.get(member_id, self) + except orm.exc.NoResultFound: + return None if not person.has_bills(): db.session.delete(person) db.session.commit() |
