Merge remote-tracking branch 'origin/v3.0'

This commit is contained in:
Adolfo Gómez García 2020-11-06 01:08:09 +01:00
commit f69a9dbc82

View File

@ -183,7 +183,7 @@ class Services(DetailHandler): # pylint: disable=too-many-public-methods
except models.Service.DoesNotExist: except models.Service.DoesNotExist:
raise self.invalidItemException() raise self.invalidItemException()
except IntegrityError: # Duplicate key probably except IntegrityError: # Duplicate key probably
if service and service.token: if service and service.token and not item:
service.delete() service.delete()
raise RequestError(_('Service token seems to be in use by other service. Please, select a new one.')) raise RequestError(_('Service token seems to be in use by other service. Please, select a new one.'))
raise RequestError(_('Element already exists (duplicate key error)')) raise RequestError(_('Element already exists (duplicate key error)'))