Beispiel #1
0
def update_repo():
    app_repo.update()
    output = [app_repo.git.show()]
    update_known_emails(app_repo.log_emails())
    output.append('/n/nKnown Emails:')
    output.extend(model.email for model in KnownEmail.select())
    print(KnownEmail.select())
    return '\n'.join(output)
Beispiel #2
0
    def post(self, request):
        data = yield from request.read()
        log.debug('{0}: {1}'.format(request, data))
        data = yield from request.json()
        name = data['name']
        email = data['email']
        password = data['password']

        if not KnownEmail.select().where(KnownEmail.email == email).exists():
            return self.error_forbidden('Email address must appear in the git commit log')
        
        try:
            user = User.create_from_registration(name, email, password)
        except EmailExistsException as exc:
            return self.error_forbidden(exc);

        asyncio.get_event_loop().create_task(self.send_validation_link(user))

        reply = dict(
            success=True,
            name=name,
            email=email,
        )
        return web.Response(body=json.dumps(reply).encode('utf-8'))