Skip to content

Commit 7cadf9f

Browse files
committed
Update link LastModified if link or thread comment is removed.
1 parent c9448d5 commit 7cadf9f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

r2/r2/controllers/api.py

+10
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,16 @@ def POST_remove(self, thing, spam):
21862186
banner=c.user.name,
21872187
train_spam=train_spam)
21882188

2189+
modified_thing = None
2190+
if isinstance(thing, Link):
2191+
modified_thing = thing
2192+
elif isinstance(thing, Comment):
2193+
modified_thing = Link._byID(thing.link_id)
2194+
2195+
if modified_thing:
2196+
set_last_modified(modified_thing, 'comments')
2197+
LastModified.touch(modified_thing._fullname, 'Comments')
2198+
21892199
if isinstance(thing, (Link, Comment)):
21902200
sr = thing.subreddit_slow
21912201
action = 'remove' + thing.__class__.__name__.lower()

0 commit comments

Comments
 (0)