From 2e2eee1cc691b91f475d33458a24315b2a313541 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 26 Apr 2016 10:00:19 +0200 Subject: Improved the Web services processors. --- src/web/views/api/v3/feed.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/web/views/api/v3/feed.py') diff --git a/src/web/views/api/v3/feed.py b/src/web/views/api/v3/feed.py index a97aa415..bf1d376f 100644 --- a/src/web/views/api/v3/feed.py +++ b/src/web/views/api/v3/feed.py @@ -6,14 +6,14 @@ from web.views.api.v3.common import AbstractProcessor from web.views.api.v3.common import url_prefix, auth_func class FeedProcessor(AbstractProcessor): + """Concrete processors for the Feed Web service. + """ + def get_single_preprocessor(self, instance_id=None, **kw): # Check if the user is authorized to modify the specified # instance of the model. - contr = FeedController(current_user.id) - feed = contr.get(id=instance_id) - if not self.is_authorized(current_user, feed): - raise ProcessingException(description='Not Authorized', code=401) - + feed = FeedController(current_user.id).get(id=instance_id) + self.is_authorized(current_user, feed) feed_processor = FeedProcessor() -- cgit