Update link LastModified if link or thread comment is removed.

This commit is contained in:
Jason Harvey
2014-01-02 13:04:21 -08:00
parent c9448d5360
commit 7cadf9fc7a

View File

@@ -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()