1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

fixed deleting element on edition instead of new

This commit is contained in:
Adolfo Gómez García 2016-03-28 06:00:43 +02:00
parent c069f51e8d
commit 6544a61f72

View File

@ -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)