Skip to content
Open
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: 3 additions & 1 deletion label_studio/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,9 @@
LICENSE = {}
VERSIONS = {}
VERSION_EDITION = 'Community'
LATEST_VERSION_CHECK = get_bool_env('LATEST_VERSION_CHECK', True)
LATEST_VERSION_CHECK = get_bool_env('LATEST_VERSION_CHECK', True) and not get_bool_env(
'LABEL_STUDIO_DISABLE_UPDATE_CHECK', False
)
VERSIONS_CHECK_TIME = 0
ALLOW_ORGANIZATION_WEBHOOKS = get_bool_env('ALLOW_ORGANIZATION_WEBHOOKS', False)
CONVERTER_DOWNLOAD_RESOURCES = get_bool_env('CONVERTER_DOWNLOAD_RESOURCES', True)
Expand Down
14 changes: 14 additions & 0 deletions label_studio/core/tests/test_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from unittest.mock import patch


def test_disable_update_check_env_var(monkeypatch):
"""LABEL_STUDIO_DISABLE_UPDATE_CHECK=true must suppress the pypi network call."""
from django.conf import settings as django_settings

monkeypatch.setattr(django_settings, 'LATEST_VERSION_CHECK', False)

with patch('label_studio.core.utils.common.get_latest_version') as mock_get:
from label_studio.core.utils.common import check_for_the_latest_version

check_for_the_latest_version(print_message=False)
mock_get.assert_not_called()
Loading