Opened 12 years ago
Closed 12 years ago
#611 closed defect (fixed)
Account deletion does not delete the media entries
Reported by: | joar | Owned by: | Elrond |
---|---|---|---|
Priority: | critical | Milestone: | 0.3.3 |
Component: | programming | Keywords: | sql |
Cc: | Parent Tickets: |
Description
When removing your account via your account settings page, the media files are deleted, but *not* the media entries themselves.
Change History (4)
comment:1 by , 12 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 12 years ago
Keywords: | sql added |
---|---|
Owner: | changed from | to
comment:3 by , 12 years ago
My time is currently very limited. So if someone else wants to take this, go ahead, without asking me.
Anyway, idea:
- Have user A and B.
- User B creates media M.
- User A post a comment on M.
- User A deletes his own account.
Solution:
In MediaComment
:
- get_author = relationship(User) + get_author = relationship(User, + backref=backref("posted_comments", + cascade="all, delete-orphan"))
And take a deep look at http://docs.sqlalchemy.org/en/rel_0_7/orm/collections.html#largecollections because the number of comments by a user might be very large, so we should probably use a subquery instead of loading them on access of the attribute.
Bonus points for a testcase!
comment:4 by , 12 years ago
Milestone: | → 0.3.3 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Okay, fixed in ff68ca9fc2b329d1c2ec395abf50358845c4e5fc
.
Stacktace: https://gist.github.com/c8725614b1e870ddee9a