Пример #1
0
    def post(self):
        success = self.initController("WipeController.post()", [])
        if not success:
            return self.response

        if 'RegistrationId' in self.data:
            token = self.data['RegistrationId']
            logging.info('Removing GCM Token: %s' % token)
            dao.remove_gcm_token(
                dao.get_gcm_token_for_id(self.irssi_user, token))
        else:
            dao.wipe_user(self.irssi_user)

        responseJson = json.dumps({'response': 'ok'})
        self.response.headers['Content-Type'] = 'application/json'
        self.response.out.write(responseJson)
Пример #2
0
    def post(self):
        success = self.initController("WipeController.post()", [])
        if not success:
            return self.response

        if 'RegistrationId' in self.data:
            token_key = self.data['RegistrationId']
            logging.info('Removing GCM Token: %s' % token_key)
            token = dao.get_gcm_token_for_id(self.irssi_user, token_key)
            if token is not None:
                dao.remove_gcm_token(token)
            else:
                logging.warning('GCM Token to be removed not found!')
        else:
            dao.wipe_user(self.irssi_user)

        responseJson = json.dumps({'response': 'ok'})
        self.response.headers['Content-Type'] = 'application/json'
        self.response.out.write(responseJson)