예제 #1
0
    def put(self, param):
        parser = reqparse.RequestParser()

        parser.add_argument('placementId',
                            type=int,
                            required=True,
                            help="The username field is required")

        data = parser.parse_args()

        user = LongrichUserModel.find_by_id(int(param))

        if user:
            user.placementId = data.placementId
            user.save()
            return {"error": 0}
        else:
            return {"error": 1}
예제 #2
0
 def identity(payload):
     user_id = payload['identity']
     return LongrichUserModel.find_by_id(user_id)