Skip to content

Commit b8af700

Browse files
chore(py): Consistently name urls using organization- prefix (#45180)
1 parent 7ba8c59 commit b8af700

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

src/sentry/api/urls.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@
652652
url(
653653
r"^accept-invite/(?P<organization_slug>[^\/]+)/(?P<member_id>[^\/]+)/(?P<token>[^\/]+)/$",
654654
AcceptOrganizationInvite.as_view(),
655-
name="sentry-api-0-accept-organization-invite-with-org",
655+
name="sentry-api-0-organization-accept-organization-invite",
656656
),
657657
url(
658658
r"^accept-invite/(?P<member_id>[^\/]+)/(?P<token>[^\/]+)/$",
@@ -695,27 +695,27 @@
695695
url(
696696
r"^(?P<monitor_id>[^\/]+)/$",
697697
MonitorDetailsEndpoint.as_view(),
698-
name="sentry-api-0-monitor-details-with-org",
698+
name="sentry-api-0-organization-monitor-details",
699699
),
700700
url(
701701
r"^(?P<monitor_id>[^\/]+)/checkins/$",
702702
MonitorCheckInsEndpoint.as_view(),
703-
name="sentry-api-0-monitor-check-in-index-with-org",
703+
name="sentry-api-0-organization-monitor-check-in-index",
704704
),
705705
url(
706706
r"^(?P<monitor_id>[^\/]+)/checkins/(?P<checkin_id>[^\/]+)/$",
707707
MonitorCheckInDetailsEndpoint.as_view(),
708-
name="sentry-api-0-monitor-check-in-details-with-org",
708+
name="sentry-api-0-organization-monitor-check-in-details",
709709
),
710710
url(
711711
r"^(?P<monitor_id>[^\/]+)/checkins/(?P<checkin_id>[^\/]+)/attachment/$",
712712
MonitorCheckInAttachmentEndpoint.as_view(),
713-
name="sentry-api-0-monitor-check-in-attachment-with-org",
713+
name="sentry-api-0-organization-monitor-check-in-attachment",
714714
),
715715
url(
716716
r"^(?P<monitor_id>[^\/]+)/stats/$",
717717
MonitorStatsEndpoint.as_view(),
718-
name="sentry-api-0-monitor-stats-with-org",
718+
name="sentry-api-0-organization-monitor-stats",
719719
),
720720
]
721721
),
@@ -2335,7 +2335,7 @@
23352335
url(
23362336
r"^organizations/(?P<organization_slug>[^\/]+)/issues/(?P<issue_id>[^\/]+)/participants/$",
23372337
GroupParticipantsEndpoint.as_view(),
2338-
name="sentry-api-0-group-stats-with-org",
2338+
name="sentry-api-0-organization-group-stats",
23392339
),
23402340
url(
23412341
r"^issues/(?P<issue_id>[^\/]+)/participants/$",
@@ -2346,7 +2346,7 @@
23462346
url(
23472347
r"^organizations/(?P<organization_slug>[^\/]+)/shared/(?:issues|groups)/(?P<share_id>[^\/]+)/$",
23482348
SharedGroupDetailsEndpoint.as_view(),
2349-
name="sentry-api-0-shared-group-details-with-org",
2349+
name="sentry-api-0-organization-shared-group-details",
23502350
),
23512351
url(
23522352
r"^shared/(?:issues|groups)/(?P<share_id>[^\/]+)/$",

src/sentry/web/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
url(
367367
r"^accept/(?P<organization_slug>[^/]+)/(?P<member_id>\d+)/(?P<token>\w+)/$",
368368
GenericReactPageView.as_view(auth_required=False),
369-
name="sentry-accept-invite-with-org",
369+
name="sentry-organization-accept-invite",
370370
),
371371
# User settings use generic_react_page_view, while any view acting on
372372
# behalf of an organization should use react_page_view

tests/sentry/api/endpoints/test_accept_organization_invite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ def _get_paths(self, args):
2828
return (
2929
reverse("sentry-api-0-accept-organization-invite", args=args),
3030
reverse(
31-
"sentry-api-0-accept-organization-invite-with-org",
31+
"sentry-api-0-organization-accept-organization-invite",
3232
args=[self.organization.slug] + args,
3333
),
3434
)
3535

3636
def _get_urls(self):
3737
return (
3838
"sentry-api-0-accept-organization-invite",
39-
"sentry-api-0-accept-organization-invite-with-org",
39+
"sentry-api-0-organization-accept-organization-invite",
4040
)
4141

4242
def _get_path(self, url, args):
@@ -350,7 +350,7 @@ def test_mismatched_org_slug(self):
350350
)
351351

352352
path = reverse(
353-
"sentry-api-0-accept-organization-invite-with-org", args=["asdf", om.id, om.token]
353+
"sentry-api-0-organization-accept-organization-invite", args=["asdf", om.id, om.token]
354354
)
355355

356356
resp = self.client.get(path)

tests/sentry/api/endpoints/test_group_participants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _get_path_functions(self):
1919
return (
2020
lambda group: reverse("sentry-api-0-group-stats", args=[group.id]),
2121
lambda group: reverse(
22-
"sentry-api-0-group-stats-with-org", args=[self.organization.slug, group.id]
22+
"sentry-api-0-organization-group-stats", args=[self.organization.slug, group.id]
2323
),
2424
)
2525

tests/sentry/api/endpoints/test_monitor_checkin_attachment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@region_silo_test(stable=True)
1414
class UploadMonitorCheckInAttachmentTest(APITestCase):
15-
endpoint = "sentry-api-0-monitor-check-in-attachment-with-org"
15+
endpoint = "sentry-api-0-organization-monitor-check-in-attachment"
1616

1717
def setUp(self):
1818
super().setUp()

tests/sentry/api/endpoints/test_monitor_checkin_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@region_silo_test(stable=True)
1212
class UpdateMonitorCheckInTest(APITestCase):
1313
endpoint = "sentry-api-0-monitor-check-in-details"
14-
endpoint_with_org = "sentry-api-0-monitor-check-in-details-with-org"
14+
endpoint_with_org = "sentry-api-0-organization-monitor-check-in-details"
1515

1616
def setUp(self):
1717
super().setUp()

tests/sentry/api/endpoints/test_monitor_checkins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@freeze_time()
1717
class CreateMonitorCheckInTest(MonitorTestCase):
1818
endpoint = "sentry-api-0-monitor-check-in-index"
19-
endpoint_with_org = "sentry-api-0-monitor-check-in-index-with-org"
19+
endpoint_with_org = "sentry-api-0-organization-monitor-check-in-index"
2020

2121
def setUp(self):
2222
super().setUp()

tests/sentry/api/endpoints/test_monitor_details.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@region_silo_test(stable=True)
77
class MonitorDetailsTest(MonitorTestCase):
88
endpoint = "sentry-api-0-monitor-details"
9-
endpoint_with_org = "sentry-api-0-monitor-details-with-org"
9+
endpoint_with_org = "sentry-api-0-organization-monitor-details"
1010

1111
def setUp(self):
1212
super().setUp()
@@ -44,7 +44,7 @@ def test_invalid_monitor_id(self):
4444
@region_silo_test(stable=True)
4545
class UpdateMonitorTest(MonitorTestCase):
4646
endpoint = "sentry-api-0-monitor-details"
47-
endpoint_with_org = "sentry-api-0-monitor-details-with-org"
47+
endpoint_with_org = "sentry-api-0-organization-monitor-details"
4848

4949
def setUp(self):
5050
super().setUp()
@@ -281,7 +281,7 @@ def test_cannot_change_project(self):
281281
@region_silo_test()
282282
class DeleteMonitorTest(MonitorTestCase):
283283
endpoint = "sentry-api-0-monitor-details"
284-
endpoint_with_org = "sentry-api-0-monitor-details-with-org"
284+
endpoint_with_org = "sentry-api-0-organization-monitor-details"
285285

286286
def setUp(self):
287287
super().setUp()

0 commit comments

Comments
 (0)