Skip to content

Commit 76d07a7

Browse files
committed
Fix security concern
1 parent 70bb8d1 commit 76d07a7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/firetower/incidents/tests/test_views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,12 @@ def test_sync_participants_endpoint_handles_errors(self):
360360

361361
assert response.status_code == 500
362362
assert response.data["success"] is False
363-
assert "Slack API error" in response.data["error"]
363+
assert response.data["error"] == "Failed to sync participants from Slack"
364364
assert len(response.data["stats"]["errors"]) > 0
365+
assert (
366+
response.data["stats"]["errors"][0]
367+
== "Failed to sync participants from Slack"
368+
)
365369

366370
def test_sync_participants_endpoint_respects_privacy(self):
367371
"""Test sync endpoint returns 404 for private incidents user can't access"""

src/firetower/incidents/views.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,13 @@ def post(self, request: Request, incident_id: str) -> Response:
152152
f"Failed to force sync participants for incident {incident.id}: {e}",
153153
exc_info=True,
154154
)
155-
error_stats = ParticipantsSyncStats(errors=[str(e)])
155+
error_stats = ParticipantsSyncStats(
156+
errors=["Failed to sync participants from Slack"]
157+
)
156158
return Response(
157159
{
158160
"success": False,
159-
"error": str(e),
161+
"error": "Failed to sync participants from Slack",
160162
"stats": asdict(error_stats),
161163
},
162164
status=500,

0 commit comments

Comments
 (0)