Skip to content

Commit

Permalink
fix(chalice): fixed heatmap update with no selected session
Browse files Browse the repository at this point in the history
  • Loading branch information
tahayk committed Jul 4, 2024
1 parent d8664ea commit 1a39732
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/chalicelib/core/custom_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def update_card(metric_id, user_id, project_id, data: schemas.CardSchema):
elif data.metric_type == schemas.MetricType.heat_map:
if data.session_id is not None:
params["session_data"] = json.dumps({"sessionId": data.session_id})
elif "data" in metric:
elif metric.get("data"):
params["session_data"] = json.dumps({"sessionId": metric["data"]["sessionId"]})

with pg_client.PostgresClient() as cur:
Expand Down
2 changes: 1 addition & 1 deletion ee/api/chalicelib/core/custom_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def update_card(metric_id, user_id, project_id, data: schemas.CardSchema):
elif data.metric_type == schemas.MetricType.heat_map:
if data.session_id is not None:
params["session_data"] = json.dumps({"sessionId": data.session_id})
elif "data" in metric:
elif metric.get("data"):
params["session_data"] = json.dumps({"sessionId": metric["data"]["sessionId"]})

with pg_client.PostgresClient() as cur:
Expand Down

0 comments on commit 1a39732

Please sign in to comment.