From 676ff29b57b37f1c11f4f3cd63f237988390e564 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Fri, 12 Feb 2021 18:19:40 -0600 Subject: [PATCH] Fix - issue #3 --- CHANGELOG.md | 7 ++++++- VERSION | 2 +- source/app/controllers/pacs/finkok/finkok.py | 19 +++++++++++-------- source/app/settings.py | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51f2819..915f598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ -v 1.41.2 [13-Feb-2021] +v 1.41.3 [12-Feb-2021] +---------------------- + - Error - Ticket #3 + + +v 1.41.2 [12-Feb-2021] ---------------------- - Error - Ticket #2 diff --git a/VERSION b/VERSION index 5008855..8de2b8f 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -1.41.2 +1.41.3 diff --git a/source/app/controllers/pacs/finkok/finkok.py b/source/app/controllers/pacs/finkok/finkok.py index 68b5aa2..a333650 100644 --- a/source/app/controllers/pacs/finkok/finkok.py +++ b/source/app/controllers/pacs/finkok/finkok.py @@ -100,6 +100,17 @@ class PACFinkok(object): return self._error def _validate_result(self, result): + if hasattr(result, 'Incidencias') and not result.Incidencias is None: + fault = result.Incidencias.Incidencia[0] + cod_error = fault.CodigoError.encode('utf-8').decode() + msg_error = fault.MensajeIncidencia.encode('utf-8').decode() + error = 'Error: {}\n{}'.format(cod_error, msg_error) + if cod_error == '307': + return result + + self._error = self.CODE.get(cod_error, error) + return {} + if hasattr(result, 'CodEstatus'): ce = result.CodEstatus if ce is None: @@ -121,14 +132,6 @@ class PACFinkok(object): log.error('CodEstatus', type(ce), ce) return result - if hasattr(result, 'Incidencias'): - fault = result.Incidencias.Incidencia[0] - cod_error = fault.CodigoError.encode('utf-8') - msg_error = fault.MensajeIncidencia.encode('utf-8') - error = 'Error: {}\n{}'.format(cod_error, msg_error) - self._error = self.CODE.get(cod_error, error) - return {} - return result def _get_result(self, client, method, args): diff --git a/source/app/settings.py b/source/app/settings.py index 89ce61b..b97fa92 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -42,7 +42,7 @@ except ImportError: DEBUG = DEBUG -VERSION = '1.41.2' +VERSION = '1.41.3' EMAIL_SUPPORT = ('soporte@empresalibre.mx',) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)