transform bug fixes in mysql clause and in get single transform
This commit is contained in:
parent
91c0181f08
commit
9a35070ad2
@ -79,7 +79,7 @@ class TransformsRepository(mysql_repository.MySQLRepository,
|
|||||||
def list_transform(self, tenant_id, transform_id):
|
def list_transform(self, tenant_id, transform_id):
|
||||||
base_query = """select * from event_transform where deleted_at IS NULL"""
|
base_query = """select * from event_transform where deleted_at IS NULL"""
|
||||||
tenant_id_clause = " and tenant_id = \"{}\"".format(tenant_id)
|
tenant_id_clause = " and tenant_id = \"{}\"".format(tenant_id)
|
||||||
transform_id_clause = " and transform_id = \"{}\"".format(transform_id)
|
transform_id_clause = " and id = \"{}\"".format(transform_id)
|
||||||
|
|
||||||
query = (base_query+
|
query = (base_query+
|
||||||
tenant_id_clause+
|
tenant_id_clause+
|
||||||
|
@ -174,26 +174,13 @@ class Transforms(transforms_api_v2.TransformsV2API):
|
|||||||
raise falcon.HTTPInternalServerError('Service unavailable',
|
raise falcon.HTTPInternalServerError('Service unavailable',
|
||||||
ex.message)
|
ex.message)
|
||||||
|
|
||||||
def _list_transform(self, tenant_id, transform_id, uri):
|
|
||||||
try:
|
|
||||||
transform = self._transforms_repo.list_transform(tenant_id,
|
|
||||||
transform_id)[0]
|
|
||||||
return transform
|
|
||||||
except repository_exceptions.RepositoryException as ex:
|
|
||||||
LOG.error(ex)
|
|
||||||
raise falcon.HTTPInternalServerError('Service unavailable',
|
|
||||||
ex.message)
|
|
||||||
|
|
||||||
def _list_transform(self, tenant_id, transform_id, uri):
|
def _list_transform(self, tenant_id, transform_id, uri):
|
||||||
try:
|
try:
|
||||||
transform = self._transforms_repo.list_transform(tenant_id,
|
transform = self._transforms_repo.list_transform(tenant_id,
|
||||||
transform_id)[0]
|
transform_id)[0]
|
||||||
transform['specification'] = yaml.safe_dump(
|
transform['specification'] = yaml.safe_dump(
|
||||||
transform['specification'])
|
transform['specification'])
|
||||||
transform_list = list()
|
return transform
|
||||||
transform_list.append(transform)
|
|
||||||
transform_list = helpers.paginate(transform, uri)
|
|
||||||
return json.dumps(transform_list, cls=MyEncoder)
|
|
||||||
except repository_exceptions.RepositoryException as ex:
|
except repository_exceptions.RepositoryException as ex:
|
||||||
LOG.error(ex)
|
LOG.error(ex)
|
||||||
raise falcon.HTTPInternalServerError('Service unavailable',
|
raise falcon.HTTPInternalServerError('Service unavailable',
|
||||||
|
Loading…
Reference in New Issue
Block a user