Skip to content

Commit d43d7f9

Browse files
committed
Disassociate preview object when deleting a Link object
1 parent f56e810 commit d43d7f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

r2/r2/controllers/api.py

+3
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,9 @@ def POST_del(self, thing):
14041404
if isinstance(thing, Link):
14051405
queries.delete(thing)
14061406
thing.subreddit_slow.remove_sticky(thing)
1407+
if thing.preview_object:
1408+
thing.set_preview_object(None)
1409+
thing._commit()
14071410
elif isinstance(thing, Comment):
14081411
link = thing.link_slow
14091412

0 commit comments

Comments
 (0)