Skip to content

Commit 220e450

Browse files
Fix ValueError by validating action_id as integer in convert_args
1 parent 513f83a commit 220e450

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sentry/api/endpoints/notifications/notification_actions_details.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ class NotificationActionsDetailsEndpoint(OrganizationEndpoint):
4747

4848
permission_classes = (NotificationActionsPermission,)
4949

50-
def convert_args(self, request: Request, action_id: int, *args, **kwargs):
50+
def convert_args(self, request: Request, action_id, *args, **kwargs):
51+
try:
52+
action_id = int(action_id)
53+
except ValueError:
54+
raise ResourceDoesNotExist("The action ID must be an integer.")
5155
parsed_args, parsed_kwargs = super().convert_args(request, *args, **kwargs)
5256
organization = parsed_kwargs["organization"]
5357
# projects where the user has access

0 commit comments

Comments
 (0)