aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/api/v3/article.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-19 14:05:24 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-19 14:05:24 +0200
commit8cc5fca2ca1592dfaaab5dc46de1c046b326fb7c (patch)
tree7dc14867ff2fc70538d9e4daf9991db745f7bcfa /src/web/views/api/v3/article.py
parentDefined an url prefix for the new API. (diff)
downloadnewspipe-8cc5fca2ca1592dfaaab5dc46de1c046b326fb7c.tar.gz
newspipe-8cc5fca2ca1592dfaaab5dc46de1c046b326fb7c.tar.bz2
newspipe-8cc5fca2ca1592dfaaab5dc46de1c046b326fb7c.zip
Added preprocessor for GET_MANY.
Diffstat (limited to 'src/web/views/api/v3/article.py')
-rw-r--r--src/web/views/api/v3/article.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/web/views/api/v3/article.py b/src/web/views/api/v3/article.py
index cc769597..ebd15d24 100644
--- a/src/web/views/api/v3/article.py
+++ b/src/web/views/api/v3/article.py
@@ -1,10 +1,15 @@
from web import models
from bootstrap import application, manager
-from web.views.api.v3.common import url_prefix, auth_func, check_auth
+from web.views.api.v3.common import url_prefix, auth_func
+from web.views.api.v3.common import get_single_preprocessor, get_many_preprocessor
blueprint_article = manager.create_api_blueprint(models.Article,
- url_prefix=url_prefix,
- methods=['GET', 'POST', 'PUT', 'DELETE'],
- preprocessors=dict(GET_SINGLE=[auth_func, check_auth]))
+ url_prefix=url_prefix,
+ methods=['GET', 'POST', 'PUT', 'DELETE'],
+ preprocessors=dict(GET_SINGLE=[auth_func, get_single_preprocessor],
+ GET_MANY=[auth_func, get_many_preprocessor],
+ PUT_SINGLE=[auth_func],
+ POST=[auth_func],
+ DELETE=[auth_func]))
application.register_blueprint(blueprint_article)
bgstack15