aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-03-22 02:48:47 +0200
committerMarcin Kuzminski <marcin@python-works.com>2012-03-22 02:48:47 +0200
commit1889707164132427d88f8990325a66ef20c58c76 (patch)
tree22911586aa4340cf214f267524dbbf1b27b966f2
parentf1290022e50ececfd10179be053beb72cd1461b2 (diff)
Cascade delete comments and notifications when removing user.
--HG-- branch : beta
-rwxr-xr-xrhodecode/model/db.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py
index 30064008..737039b9 100755
--- a/rhodecode/model/db.py
+++ b/rhodecode/model/db.py
@@ -307,7 +307,11 @@ class User(Base, BaseModel):
group_member = relationship('UsersGroupMember', cascade='all')
- notifications = relationship('UserNotification',)
+ notifications = relationship('UserNotification', cascade='all')
+ # notifications assigned to this user
+ user_created_notifications = relationship('Notification', cascade='all')
+ # comments created by this user
+ user_comments = relationship('ChangesetComment', cascade='all')
@hybrid_property
def email(self):