Пример #1
0
    def post(self):
        # TODO: wheezy.validation validate
        email = self.request.form.get("email")
        email = email and email[0]
        if not email:
            # TODO: do something horrible
            logger.debug("no email")

        locale = useful.get_locale_from_http(self.request)
        doc = {"stamp": time.time(), "email": email, "locale": locale}
        logger.debug(doc)
        rc = model.register(doc)
        logger.debug(rc)
        mc = model.client()
        logger.debug(mc.early.find_one())
Пример #2
0
    def post(self):
        # TODO: wheezy.validation validate
        email = self.request.form.get('email')
        password = self.request.form.get('password')
        _x = self.request.form.get('_x')

        email = email and email[0]
        password = password and password[0]
        if not email or not password:
            # TODO: do something horrible
            logger.debug('no email, no password: %s %s' %(email, password))

        locale = useful.get_locale_from_http(self.request)
        doc = {
            'stamp':time.time(),
            'email':email,
            'password':password,
            'locale':locale
        }
        rc = model.register(doc)
        mc = model.client()
        return self.json_response({'errors': self.errors})