Skip to content

Commit a0b928d

Browse files
authored
ref(participants): Check for group list (#58204)
Group list is an optional param so we need to check if it exists before trying to check a feature flag's status. Fixes SENTRY-16V3
1 parent 951b588 commit a0b928d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Diff for: src/sentry/api/helpers/group_index/update.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def get_current_release_version_of_group(
164164

165165
def update_groups(
166166
request: Request,
167-
group_ids: Sequence[int],
167+
group_ids: Sequence[int] | None,
168168
projects: Sequence[Project],
169169
organization_id: int,
170170
search_fn: SearchFunction | None,
@@ -711,7 +711,7 @@ def handle_is_subscribed(
711711

712712
def handle_is_bookmarked(
713713
is_bookmarked: bool,
714-
group_list: Sequence[Group],
714+
group_list: Sequence[Group] | None,
715715
group_ids: Sequence[Group],
716716
project_lookup: Dict[int, Project],
717717
acting_user: User | None,
@@ -734,11 +734,12 @@ def handle_is_bookmarked(
734734
group__in=group_ids,
735735
user_id=acting_user.id if acting_user else None,
736736
).delete()
737-
if features.has("organizations:participants-purge", group_list[0].organization):
738-
GroupSubscription.objects.filter(
739-
user_id=acting_user.id,
740-
group__in=group_ids,
741-
).delete()
737+
if group_list:
738+
if features.has("organizations:participants-purge", group_list[0].organization):
739+
GroupSubscription.objects.filter(
740+
user_id=acting_user.id,
741+
group__in=group_ids,
742+
).delete()
742743

743744

744745
def handle_has_seen(

0 commit comments

Comments
 (0)