diff --git a/src/sentry/issues/endpoints/organization_group_search_views.py b/src/sentry/issues/endpoints/organization_group_search_views.py index 5e840599f9c7fc..ef3b71a2c3fc5a 100644 --- a/src/sentry/issues/endpoints/organization_group_search_views.py +++ b/src/sentry/issues/endpoints/organization_group_search_views.py @@ -110,34 +110,18 @@ def get(self, request: Request, organization: Organization) -> Response: data={"detail": "You do not have access to any projects."}, ) - if features.has("organizations:issue-view-sharing", organization): - starred_views = GroupSearchViewStarred.objects.filter( - organization=organization, user_id=request.user.id - ) - - return self.paginate( - request=request, - queryset=starred_views, - order_by="position", - on_results=lambda x: serialize( - x, - request.user, - serializer=GroupSearchViewStarredSerializer( - has_global_views=has_global_views, - default_project=default_project, - organization=organization, - ), - ), - ) + starred_views = GroupSearchViewStarred.objects.filter( + organization=organization, user_id=request.user.id + ) return self.paginate( request=request, - queryset=query, + queryset=starred_views, order_by="position", on_results=lambda x: serialize( x, request.user, - serializer=GroupSearchViewSerializer( + serializer=GroupSearchViewStarredSerializer( has_global_views=has_global_views, default_project=default_project, organization=organization, diff --git a/tests/sentry/issues/endpoints/test_organization_group_search_views.py b/tests/sentry/issues/endpoints/test_organization_group_search_views.py index 4ea14e20508ee5..cab6b0bea414b9 100644 --- a/tests/sentry/issues/endpoints/test_organization_group_search_views.py +++ b/tests/sentry/issues/endpoints/test_organization_group_search_views.py @@ -130,7 +130,6 @@ class OrganizationGroupSearchViewsGetTest(BaseGSVTestCase): @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_get_user_one_custom_views(self) -> None: objs = self.create_base_data() @@ -164,7 +163,6 @@ def test_last_visited_exists_for_seen_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_get_user_two_custom_views(self) -> None: objs = self.create_base_data() @@ -175,7 +173,6 @@ def test_get_user_two_custom_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_get_default_views(self) -> None: self.create_base_data() @@ -192,7 +189,6 @@ def test_get_default_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_get_views_has_correct_default_page_filters(self) -> None: self.create_base_data() @@ -219,7 +215,6 @@ def setUp(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_deletes_missing_views(self) -> None: views = self.client.get(self.url).data @@ -257,7 +252,6 @@ def test_deletes_missing_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_adds_view_with_no_id(self) -> None: views = self.client.get(self.url).data views.append( @@ -286,7 +280,6 @@ def test_adds_view_with_no_id(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_reorder_views(self) -> None: views = self.client.get(self.url).data view_one = views[0] @@ -316,7 +309,6 @@ def test_reorder_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_rename_views(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -329,7 +321,6 @@ def test_rename_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_change_query(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -342,7 +333,6 @@ def test_change_query(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_change_sort(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -355,7 +345,6 @@ def test_change_sort(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_change_everything(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -379,7 +368,6 @@ def test_change_everything(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_invalid_no_views(self) -> None: response = self.get_error_response(self.organization.slug, views=[]) @@ -391,7 +379,6 @@ def test_invalid_no_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_invalid_sort(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -410,7 +397,6 @@ def test_invalid_sort(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_invalid_over_max_views(self) -> None: from sentry.api.serializers.rest_framework.groupsearchview import MAX_VIEWS @@ -429,7 +415,6 @@ def test_invalid_over_max_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_updated_deleted_view(self) -> None: views = self.client.get(self.url).data @@ -552,7 +537,6 @@ def setUp(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_not_including_page_filters_does_not_reset_them_for_existing_views(self) -> None: views = self.client.get(self.url).data @@ -578,7 +562,6 @@ def test_not_including_page_filters_does_not_reset_them_for_existing_views(self) @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_default_page_filters_with_global_views(self) -> None: views = self.client.get(self.url).data views.append( @@ -597,7 +580,6 @@ def test_default_page_filters_with_global_views(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_one_project_to_zero_projects(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -609,7 +591,6 @@ def test_one_project_to_zero_projects(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_to_all_projects(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -621,7 +602,6 @@ def test_to_all_projects(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_one_environment_to_zero_environments(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -632,7 +612,6 @@ def test_one_environment_to_zero_environments(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_update_time_filters(self) -> None: views = self.client.get(self.url).data view = views[0] @@ -643,7 +622,6 @@ def test_update_time_filters(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_empty_time_filters_resets_to_default(self) -> None: views = self.client.get(self.url).data views[0]["timeFilters"] = {} @@ -692,7 +670,6 @@ class OrganizationGroupSearchViewsProjectsTransactionTest(TransactionTestCase): # the test has finished. This causes the endpoint to unexpectedly succeed when it should fail. @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_invalid_project_ids(self) -> None: url = reverse( "sentry-api-0-organization-group-search-views", @@ -874,7 +851,6 @@ def setUp(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_basic_get_page_filters_with_global_filters(self) -> None: self.login_as(user=self.user) response = self.client.get(self.url) @@ -928,7 +904,6 @@ def test_get_page_filters_without_global_filters_user_2(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_default_page_filters_with_global_views(self) -> None: self.login_as(user=self.user_3) response = self.client.get(self.url) @@ -987,7 +962,6 @@ def setUp(self) -> None: @with_feature({"organizations:issue-stream-custom-views": True}) @with_feature({"organizations:global-views": True}) - @with_feature({"organizations:issue-view-sharing": True}) def test_cannot_rename_other_users_views(self) -> None: self.login_as(user=self.user) views = self.client.get(self.url).data