Skip to content

Commit f9367d3

Browse files
committed
Remove STORE_PAGEVIEWS feature
1 parent f4875a2 commit f9367d3

File tree

4 files changed

+1
-16
lines changed

4 files changed

+1
-16
lines changed

readthedocs/analytics/proxied_api.py

-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ def get(self, request, *args, **kwargs):
6262
# pylint: disable=no-self-use
6363
def increase_page_view_count(self, request, project, version, absolute_uri):
6464
"""Increase the page view count for the given project."""
65-
if not absolute_uri or not project.has_feature(Feature.STORE_PAGEVIEWS):
66-
return
67-
6865
unresolved = unresolve_from_request(request, absolute_uri)
6966
if not unresolved:
7067
return

readthedocs/analytics/tests.py

-5
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ def test_increase_page_view_count(self):
129129
PageView.objects.all().count() == 0
130130
)
131131

132-
feature, _ = Feature.objects.get_or_create(
133-
feature_id=Feature.STORE_PAGEVIEWS,
134-
)
135-
self.project.feature_set.add(feature)
136-
137132
# testing for yesterday
138133
with mock.patch('readthedocs.analytics.tasks.timezone.now') as mocked_timezone:
139134
mocked_timezone.return_value = self.yesterday

readthedocs/projects/views/private.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ def get_context_data(self, **kwargs):
11311131

11321132
def _is_enabled(self, project):
11331133
"""Should we show traffic analytics for this project?"""
1134-
return project.has_feature(Feature.STORE_PAGEVIEWS)
1134+
return True
11351135

11361136

11371137
class TrafficAnalyticsView(SettingsOverrideObject):

readthedocs/rtd_tests/tests/test_footer.py

-7
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,6 @@ def setUp(self):
452452
)
453453
self.host = 'pip.readthedocs.io'
454454

455-
# Run tests with all available features
456-
# that can increase the number of queries.
457-
feature, _ = Feature.objects.get_or_create(
458-
feature_id=Feature.STORE_PAGEVIEWS,
459-
)
460-
self.pip.feature_set.add(feature)
461-
462455
def test_version_queries(self):
463456
with self.assertNumQueries(self.EXPECTED_QUERIES):
464457
response = self.client.get(self.url, HTTP_HOST=self.host)

0 commit comments

Comments
 (0)