Skip to content

Commit

Permalink
Small optimization to not compute the highest version when it isn't d…
Browse files Browse the repository at this point in the history
…isplayed

We added a setting about whether to show this to the user or not,
but always calculated the data regardless of the setting.
  • Loading branch information
ericholscher committed Nov 7, 2019
1 parent f30eb28 commit 8300f63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions readthedocs/api/v2/views/footer_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def get_version_compare_data(project, base_version=None):
:param base_version: We assert whether or not the base_version is also the
highest version in the resulting "is_highest" value.
"""
if not project.show_version_warning:
return {'is_highest': False}
versions_qs = Version.internal.public(project=project)

# Take preferences over tags only if the project has at least one tag
Expand Down

0 comments on commit 8300f63

Please sign in to comment.