Skip to content
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

Traffic analytics: don't pass context if the feature isn't enabled #7740

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Dec 9, 2020

Currently we are showing the data even if the feature isn't enabled.

This is noticeable on .com mainly.

Currently we are showing the data even if the feature isn't enabled.
@stsewd stsewd requested a review from a team December 9, 2020 18:50
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I would be good to have a test for this probably.

Comment on lines 1101 to -1099
'top_viewed_pages': top_viewed_pages,
'page_data': page_data,
'enabled': self._is_enabled(project),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this fail if we don't pass top_viewed_pages?

{% for page, count in top_viewed_pages %}

Maybe that HTML block needs to check for if enabled, don't you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When templates find null data, they just ignore it, in this case it goes to the empty block.

@stsewd stsewd merged commit d1e08ef into master Dec 10, 2020
@stsewd stsewd deleted the dont-update-context branch December 10, 2020 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants