Esempio n. 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)
Esempio n. 2
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)
Esempio n. 3
0
    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)