diff --git a/app/views/building.py b/app/views/building.py index dae47f2ef7af9299a7b1b0ad5e74f9ab6503e5e8..8e5615121eb73956ed6ade4e7b23d767ac912223 100644 --- a/app/views/building.py +++ b/app/views/building.py @@ -2,17 +2,15 @@ from flask import request from werkzeug.exceptions import MethodNotAllowed from ..controllers.building import BuildingController -from .base import UnprotectedRestView -from ..permissions.application import app_need +from .base import RestView -class BuildingView(UnprotectedRestView): +class BuildingView(RestView): """The building view.""" def get_controller(self): """Return an instance of the building controller.""" return BuildingController() - @app_need def index(self): """/ GET - Retrieve a list of resources.""" # TODO: Add data key back to self.json @@ -23,7 +21,6 @@ class BuildingView(UnprotectedRestView): ] }) - @app_need def get(self, id_): """/{id} GET - Retrieve a resource by id.""" # TODO: Add data key back in self.json diff --git a/app/views/turk_hit.py b/app/views/turk_hit.py index b5edaa639e0ca58ceac7ac9b86fd39cf2d23571f..2aea9b27516e341d856155395fcf114df23bf33f 100644 --- a/app/views/turk_hit.py +++ b/app/views/turk_hit.py @@ -1,14 +1,13 @@ """Views for working with turk_hit.""" +from flask import request from werkzeug.exceptions import (BadRequest, NotFound, MethodNotAllowed, BadGateway) -from ..controllers.turk_hit import TurkHitController -from .base import UnprotectedRestView -from ..permissions.application import app_need from boto.mturk.connection import MTurkRequestError -from flask import request +from ..controllers.turk_hit import TurkHitController +from .base import RestView -class TurkHitView(UnprotectedRestView): +class TurkHitView(RestView): """The turk hit view.""" def get_controller(self): """Return an instance of the turk hit controller.""" @@ -17,7 +16,6 @@ class TurkHitView(UnprotectedRestView): def index(self): raise MethodNotAllowed() - @app_need def get(self, id_): """/{id} GET - Retrieve the hit status by building id.""" try: @@ -30,7 +28,6 @@ class TurkHitView(UnprotectedRestView): raise BadGateway(error.error_code) return self.json(response) - @app_need def post(self): """/ POST - Create a hit given an id in the POST body""" try: @@ -42,7 +39,6 @@ class TurkHitView(UnprotectedRestView): return self.json(response, 201) - @app_need def put(self, id_): """ / PUT - Approve or decline a hit given a building_id.