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,6 +145,7 @@ 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:
if item is None:
self._deleteIncompleteService(service)
raise RequestError(_('Input error: {0}'.format(unicode(e))))
except Exception as e: