From 7cadf9fc7a47b6da460bf3a0be44a8523eefeabc Mon Sep 17 00:00:00 2001 From: Jason Harvey Date: Thu, 2 Jan 2014 13:04:21 -0800 Subject: [PATCH] Update link LastModified if link or thread comment is removed. --- r2/r2/controllers/api.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index dfc708eb7..cc2d72101 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -2186,6 +2186,16 @@ class ApiController(RedditController, OAuth2ResourceController): banner=c.user.name, train_spam=train_spam) + modified_thing = None + if isinstance(thing, Link): + modified_thing = thing + elif isinstance(thing, Comment): + modified_thing = Link._byID(thing.link_id) + + if modified_thing: + set_last_modified(modified_thing, 'comments') + LastModified.touch(modified_thing._fullname, 'Comments') + if isinstance(thing, (Link, Comment)): sr = thing.subreddit_slow action = 'remove' + thing.__class__.__name__.lower()