Exemplo n.º 1
0
 def get(self, id):
     try:
         user = UserModel.fetch_by_id(id)
         return user_schema.dump(user), 200
     except KeyError as e:
         api.abort(500,
                   e.__doc__,
                   status="Could not perform this action",
                   statusCode="500")
     except KeyError as e:
         api.abort(400,
                   e.__doc__,
                   status="Could not perform this action",
                   statusCode="400")
Exemplo n.º 2
0
    def get(self,id):

        user = UserModel.fetch_by_id(id)
        return user_schema.dump(user)