diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index d8d9d0c85..92fcbcc15 100644 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -1407,8 +1407,11 @@ class ApiController(RedditController): VModhash(), VSrCanBan('id'), thing=VByName('id', thing_cls=Link)) + @api_doc(api_section.links_and_comments) def POST_lock(self, thing): - """Lock a comment thread. + """Lock a link. + + Prevents a post from receiving new comments. See also: [/api/unlock](#POST_api_unlock). @@ -1426,14 +1429,16 @@ class ApiController(RedditController): ModAction.create(thing.subreddit_slow, c.user, target=thing, action='lock') - @require_oauth2_scope("modposts") @noresponse(VUser(), VModhash(), VSrCanBan('id'), thing=VByName('id', thing_cls=Link)) + @api_doc(api_section.links_and_comments) def POST_unlock(self, thing): - """Unlock a comment thread. + """Unlock a link. + + Allow a post to receive new comments. See also: [/api/lock](#POST_api_lock). diff --git a/r2/r2/lib/jsontemplates.py b/r2/r2/lib/jsontemplates.py index 8124d58e5..09a049e56 100644 --- a/r2/r2/lib/jsontemplates.py +++ b/r2/r2/lib/jsontemplates.py @@ -621,6 +621,7 @@ class LinkJsonTemplate(ThingJsonTemplate): likes="likes", link_flair_css_class="flair_css_class", link_flair_text="flair_text", + locked="locked", media="media_object", media_embed="media_embed", num_comments="num_comments",