diff --git a/api/chalicelib/core/product_analytics.py b/api/chalicelib/core/product_analytics.py index 499ee8f44..fa8c56640 100644 --- a/api/chalicelib/core/product_analytics.py +++ b/api/chalicelib/core/product_analytics.py @@ -124,6 +124,8 @@ def path_analysis(project_id: int, data: schemas.CardPathAnalysis): exclusions = {} for i, ef in enumerate(data.excludes): + if len(ef.value) == 0: + continue if ef.type in data.metric_value: f_k = f"exclude_{i}" extra_values = {**extra_values, **sh.multi_values(ef.value, value_key=f_k)} diff --git a/api/routers/core_dynamic.py b/api/routers/core_dynamic.py index 8a213bd2a..b58fcce9d 100644 --- a/api/routers/core_dynamic.py +++ b/api/routers/core_dynamic.py @@ -100,8 +100,8 @@ def get_account(context: schemas.CurrentContext = Depends(OR_context)): r = users.get(tenant_id=context.tenant_id, user_id=context.user_id) t = tenants.get_by_tenant_id(context.tenant_id) if t is not None: - t.pop("createdAt") - t["tenantName"] = t.pop("name") + t["createdAt"] = TimeUTC.datetime_to_timestamp(t["createdAt"]) + t["tenantName"] = t.get("name") return { 'data': { **r, diff --git a/ee/api/chalicelib/core/product_analytics.py b/ee/api/chalicelib/core/product_analytics.py index 873044b89..9f1a5b29d 100644 --- a/ee/api/chalicelib/core/product_analytics.py +++ b/ee/api/chalicelib/core/product_analytics.py @@ -129,6 +129,8 @@ def path_analysis(project_id: int, data: schemas.CardPathAnalysis): exclusions = {} for i, ef in enumerate(data.excludes): + if len(ef.value) == 0: + continue if ef.type in data.metric_value: f_k = f"exclude_{i}" extra_values = {**extra_values, **sh.multi_values(ef.value, value_key=f_k)} diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index 2529f544f..bcf96e83a 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -249,6 +249,7 @@ def get(user_id, tenant_id): cur.mogrify( f"""SELECT users.user_id, + users.tenant_id, email, role, users.name, diff --git a/ee/api/routers/core_dynamic.py b/ee/api/routers/core_dynamic.py index c2e37bc82..c40285c99 100644 --- a/ee/api/routers/core_dynamic.py +++ b/ee/api/routers/core_dynamic.py @@ -105,8 +105,8 @@ def get_account(context: schemas.CurrentContext = Depends(OR_context)): r = users.get(tenant_id=context.tenant_id, user_id=context.user_id) t = tenants.get_by_tenant_id(context.tenant_id) if t is not None: - t.pop("createdAt") - t["tenantName"] = t.pop("name") + t["createdAt"] = TimeUTC.datetime_to_timestamp(t["createdAt"]) + t["tenantName"] = t.get("name") return { 'data': { **r,