From df82c3854c06cc2345a185d607a1eecbae9f12ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 30 Mar 2023 01:20:50 +0200 Subject: [PATCH] minor fixes for 3.5 --- client-py3/full/src/UDSClient.py | 2 ++ client-py3/full/src/uds/rest.py | 2 ++ server/src/uds/REST/methods/client.py | 11 +++++++---- server/src/uds/web/views/auth.py | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client-py3/full/src/UDSClient.py b/client-py3/full/src/UDSClient.py index b3bb752f4..771b04c67 100755 --- a/client-py3/full/src/UDSClient.py +++ b/client-py3/full/src/UDSClient.py @@ -151,6 +151,8 @@ class UDSClient(QtWidgets.QMainWindow): return except Exception as e: self.showError(e) + self.closeWindow() + return self.getTransportData() diff --git a/client-py3/full/src/uds/rest.py b/client-py3/full/src/uds/rest.py index bda7cd099..ab983065f 100644 --- a/client-py3/full/src/uds/rest.py +++ b/client-py3/full/src/uds/rest.py @@ -127,6 +127,8 @@ class RestApi: raise InvalidVersion(downloadUrl) return self._serverVersion + except InvalidVersion: + raise except Exception as e: raise UDSException(e) diff --git a/server/src/uds/REST/methods/client.py b/server/src/uds/REST/methods/client.py index f198d37b7..0c37c5da7 100644 --- a/server/src/uds/REST/methods/client.py +++ b/server/src/uds/REST/methods/client.py @@ -52,7 +52,7 @@ if typing.TYPE_CHECKING: logger = logging.getLogger(__name__) #CLIENT_VERSION = UDS_VERSION -REQUIRED_CLIENT_VERSION = '3.5.1' +REQUIRED_CLIENT_VERSION = '3.6.0' CLIENT_VERSION = REQUIRED_CLIENT_VERSION @@ -116,9 +116,7 @@ class Client(Handler): { 'availableVersion': CLIENT_VERSION, 'requiredVersion': REQUIRED_CLIENT_VERSION, - 'downloadUrl': self._request.build_absolute_uri( - reverse('page.client-download') - ), + 'downloadUrl': 'A new version of UDS Client is required.\nPlease, download it from Client Download section.', } ) @@ -134,6 +132,11 @@ class Client(Handler): self._args ) # If more than 2 args, got an error. pylint: disable=unbalanced-tuple-unpacking hostname = self._params['hostname'] # Or if hostname is not included... + + version = self._params.get('version', '0.0.0') + if version < '3.6.0': + return Client.result(error='Client version not supported.\n Please, upgrade it.') + srcIp = self._request.ip # Ip is optional, diff --git a/server/src/uds/web/views/auth.py b/server/src/uds/web/views/auth.py index 26b904934..eb55052f7 100644 --- a/server/src/uds/web/views/auth.py +++ b/server/src/uds/web/views/auth.py @@ -136,7 +136,7 @@ def authCallback_stage2( return response except auths.exceptions.Redirect as e: return HttpResponseRedirect( - request.build_absolute_uri(str(e)) if e.args and e.args[0] else '/' + request.build_absolute_uri(str(e)) if e.args and e.args[0] != '/' else '/' ) except auths.exceptions.Logout as e: return webLogout(