Make POST_hide only allow Links through VByName.

Someone has been sending Comment fullnames to POST_hide and that
results in an error on our side and a 500 for them. They really
should be getting a proper error message back instead.
This commit is contained in:
Neil Williams
2012-07-05 23:01:14 -07:00
committed by shlurbee
parent 85f6b2a5c7
commit 77ba2db3fe

View File

@@ -1725,7 +1725,7 @@ class ApiController(RedditController):
@noresponse(VUser(),
VModhash(),
thing = VByName('id'))
thing = VByName('id', thing_cls=Link))
@api_doc(api_section.links_and_comments)
def POST_hide(self, thing):
if not thing: return