Esempio n. 1
0
    def post(self, entity):
        """Starts following a user, defined by the post data"""
        try:
            post_data = json.loads(request.data)
        except json.JSONDecodeError as e:
            raise APIBadRequest(str(e))

        if not post_data:
            raise APIBadRequest("No POST data.")

        follower = follow.start_following(entity, post_data)
        return jsonify(follower.to_json())
Esempio n. 2
0
    def post(self, entity):
        """Starts following a user, defined by the post data"""
        try:
            post_data = json.loads(request.data)
        except json.JSONDecodeError as e:
            raise APIBadRequest(str(e))

        if not post_data:
            raise APIBadRequest("No POST data.")

        follower = follow.start_following(entity, post_data)
        return jsonify(follower.to_json())
Esempio n. 3
0
 def post(self):
     """Starts following a user, defined by the post data"""
     return jsonify(follow.start_following(g.entity, request.json))
Esempio n. 4
0
 def post(self):
     """Starts following a user, defined by the post data"""
     return jsonify(follow.start_following(g.entity, request.json))