Skip to content

Commit bf3d58b

Browse files
committed
fix(weekly_report): Switch to uuidv4
switch to uuidv4 like the other alerts
1 parent bd19446 commit bf3d58b

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

Diff for: src/sentry/notifications/utils/__init__.py

-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from __future__ import annotations
22

33
import logging
4-
import random
5-
import string
64
import time
75
from collections import defaultdict
86
from dataclasses import dataclass
@@ -443,13 +441,6 @@ def get_replay_id(event: Event | GroupEvent) -> str | None:
443441
return replay_id
444442

445443

446-
def generate_notification_uuid() -> str:
447-
"""
448-
Generates a random string of 16 characters to be used as a notification uuid
449-
"""
450-
return "".join(random.choices(string.ascii_letters + string.digits, k=16))
451-
452-
453444
@dataclass
454445
class PerformanceProblemContext:
455446
problem: PerformanceProblem

Diff for: src/sentry/tasks/weekly_reports.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import heapq
44
import logging
5+
import uuid
56
from datetime import timedelta
67
from functools import partial, reduce
78
from typing import Tuple
@@ -32,7 +33,6 @@
3233
OrganizationMember,
3334
OrganizationStatus,
3435
)
35-
from sentry.notifications.utils import generate_notification_uuid
3636
from sentry.services.hybrid_cloud.user_option import user_option_service
3737
from sentry.silo import SiloMode
3838
from sentry.snuba.dataset import Dataset
@@ -743,7 +743,7 @@ def render_template_context(ctx, user_id):
743743
"organizations:session-replay", ctx.organization
744744
) and features.has("organizations:session-replay-weekly-email", ctx.organization)
745745

746-
notification_uuid = generate_notification_uuid()
746+
notification_uuid = str(uuid.uuid4())
747747

748748
# Render the first section of the email where we had the table showing the
749749
# number of accepted/dropped errors/transactions for each project.

0 commit comments

Comments
 (0)