Skip to content

Fixed remove_search_analytics issue #6447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/guides/feature-flags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,4 @@ e.g. python-reno release notes manager is known to do that

``USE_TESTING_BUILD_IMAGE``: :featureflags:`USE_TESTING_BUILD_IMAGE`

``EXTERNAL_VERSION_BUILD``: :featureflags:`EXTERNAL_VERSION_BUILD`

``SEARCH_ANALYTICS``: :featureflags:`SEARCH_ANALYTICS`
``EXTERNAL_VERSION_BUILD``: :featureflags:`EXTERNAL_VERSION_BUILD`
6 changes: 1 addition & 5 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,6 @@ def add_features(sender, **kwargs):
EXTERNAL_VERSION_BUILD = 'external_version_build'
UPDATE_CONDA_STARTUP = 'update_conda_startup'
CONDA_APPEND_CORE_REQUIREMENTS = 'conda_append_core_requirements'
SEARCH_ANALYTICS = 'search_analytics'

FEATURES = (
(USE_SPHINX_LATEST, _('Use latest version of Sphinx')),
Expand Down Expand Up @@ -1532,10 +1531,7 @@ def add_features(sender, **kwargs):
CONDA_APPEND_CORE_REQUIREMENTS,
_('Append Read the Docs core requirements to environment.yml file'),
),
(
SEARCH_ANALYTICS,
_('Enable search analytics'),
)

)

projects = models.ManyToManyField(
Expand Down
6 changes: 0 additions & 6 deletions readthedocs/projects/views/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,12 +1006,6 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
project = self.get_project()

context['show_analytics'] = project.has_feature(
Feature.SEARCH_ANALYTICS,
)
if not context['show_analytics']:
return context

# data for plotting the line-chart
query_count_of_1_month = SearchQuery.generate_queries_count_of_one_month(
project.slug,
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def setUp(self):
test_time = timezone.datetime(2019, 8, 2, 12, 0)
self.test_time = timezone.make_aware(test_time)

get(Feature, projects=[self.pip], feature_id=Feature.SEARCH_ANALYTICS)
get(Feature, projects=[self.pip])

def test_top_queries(self):
with mock.patch('django.utils.timezone.now') as test_time:
Expand Down