mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
Add support for PUT and DELETE requests.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user