コード例 #1
0
ファイル: resources.py プロジェクト: pglass/Rift
    def on_put(self, req, resp, tenant_id):
        tenant = Tenant.get_tenant(tenant_id)
        if tenant:
            body = self.load_body(req)
            body['tenant_id'] = tenant_id

            tenant = Tenant.build_tenant_from_dict(body)
            Tenant.update_tenant(tenant)
        else:
            msg = 'Cannot find tenant: {tenant_id}'.format(tenant_id=tenant_id)
            resp.status = falcon.HTTP_404
            resp.body = json.dumps({'description': msg})
コード例 #2
0
ファイル: resources.py プロジェクト: malini-kamalambal/Rift
    def on_put(self, req, resp, tenant_id):
        tenant = Tenant.get_tenant(tenant_id)
        if tenant:
            body = self.load_body(req)
            body['tenant_id'] = tenant_id

            tenant = Tenant.build_tenant_from_dict(body)
            Tenant.update_tenant(tenant)
        else:
            msg = 'Cannot find tenant: {tenant_id}'.format(tenant_id=tenant_id)
            resp.status = falcon.HTTP_404
            resp.body = json.dumps({'description': msg})