From 77ba2db3fe0661bed9622971c3113e018cfc2652 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 5 Jul 2012 23:01:14 -0700 Subject: [PATCH] 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. --- r2/r2/controllers/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 7b0da2677..94b810360 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -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