示例#1
0
    def post(self):
        args = self.get_args()
        self.validate(args)
        user = self.bind(args)
        if not current_user.is_user() and not current_user.user:
            current_user.user = user.id
            current_user.sync(user)
            current_user.save()

        um.models.UserLog.bind(user.id, args['device'], key=self.key)
        return self.success(user, args)
示例#2
0
文件: apis.py 项目: PyFansLi/chiki
    def post(self):
        args = self.get_args()
        self.validate(args)
        user = self.bind(args)
        if not current_user.is_user() and not current_user.user:
            current_user.user = user.id
            current_user.sync(user)
            current_user.save()

        um.models.UserLog.bind(user.id, args['device'], key=self.key)
        return self.success(user, args)
示例#3
0
文件: apis.py 项目: guoronghua/chiki
    def post(self):
        if current_user.is_user():
            abort(NOT_ALLOW_BIND)

        if current_user.user:
            abort(BINDED)

        args = self.get_args()
        self.validate(args)
        user = self.bind(args)

        current_user.user = user.id
        current_user.sync(user)
        current_user.save()

        um.models.UserLog.bind(user.id, args['device'], key=self.key)
        return self.success(user, args)