Add support for PUT and DELETE requests.

This commit is contained in:
Max Goodman
2013-03-09 00:07:21 -08:00
parent b2b15a79b5
commit cbef2f3dae
2 changed files with 3 additions and 2 deletions

View File

@@ -125,8 +125,9 @@ class ApidocsController(RedditController):
if not action:
continue
valid_methods = ('GET', 'POST', 'PUT', 'DELETE')
api_doc = getattr(func, '_api_doc', None)
if api_doc and 'section' in api_doc and method in ('GET', 'POST'):
if api_doc and 'section' in api_doc and method in valid_methods:
docs = {}
docs['doc'] = inspect.getdoc(func)

View File

@@ -205,7 +205,7 @@ class ErrorController(RedditController):
except Exception as e:
return handle_awful_failure("ErrorController.GET_document: %r" % e)
POST_document = GET_document
POST_document = PUT_document = DELETE_document = GET_document
def handle_awful_failure(fail_text):
"""