Small optimization to not compute the highest version when it isn't displayed
We added a setting about whether to show this to the user or not,
but always calculated the data regardless of the setting.
@@ -26,6 +26,9 @@ 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)
.filter(built=True, active=True)
