From 2193e07582a8dcbfcded13e12a8a3e271a6effc4 Mon Sep 17 00:00:00 2001 From: Tomas Mizera Date: Fri, 29 Nov 2024 14:32:52 +0100 Subject: [PATCH] Remove deprecated server validation use --- Mergin/utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Mergin/utils.py b/Mergin/utils.py index 8e20d18..f8e0a73 100644 --- a/Mergin/utils.py +++ b/Mergin/utils.py @@ -399,14 +399,13 @@ def send_logs(username, logfile): def validate_mergin_url(url): """ - Validation of mergin URL by pinging. Checks if URL points at compatible Mergin server. + Initiates connection to the provided server URL to check if the server is accessible :param url: String Mergin Maps URL to ping. :return: String error message as result of validation. If None, URL is valid. """ try: - mc = MerginClient(url, proxy_config=get_qgis_proxy_config(url)) - if not mc.is_server_compatible(): - return "Incompatible Mergin Maps server" + _ = MerginClient(url, proxy_config=get_qgis_proxy_config(url)) + # Valid but not Mergin URl except ClientError: return "Invalid Mergin Maps URL" @@ -1223,7 +1222,7 @@ def test_server_connection(url, username, password): result = True, " OK " proxy_config = get_qgis_proxy_config(url) try: - mc = MerginClient(url, None, username, password, get_plugin_version(), proxy_config) + _ = MerginClient(url, None, username, password, get_plugin_version(), proxy_config) except (LoginError, ClientError) as e: QgsApplication.messageLog().logMessage(f"Mergin Maps plugin: {str(e)}") result = False, f" Connection failed, {str(e)} "