From 6544a61f72e9c7e6f4e9fef4cad549f167542c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Mon, 28 Mar 2016 06:00:43 +0200 Subject: [PATCH] fixed deleting element on edition instead of new --- server/src/uds/REST/methods/services.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/uds/REST/methods/services.py b/server/src/uds/REST/methods/services.py index 9926880a..697d95cf 100644 --- a/server/src/uds/REST/methods/services.py +++ b/server/src/uds/REST/methods/services.py @@ -145,7 +145,8 @@ class Services(DetailHandler): # pylint: disable=too-many-public-methods except IntegrityError: # Duplicate key probably raise RequestError(_('Element already exists (duplicate key error)')) except coreService.ValidationException as e: - self._deleteIncompleteService(service) + if item is None: + self._deleteIncompleteService(service) raise RequestError(_('Input error: {0}'.format(unicode(e)))) except Exception as e: self._deleteIncompleteService(service)