forked from shaba/openuds
fixed incorrectly removing service with token on edition of service and duplication of token
This commit is contained in:
parent
9d19aebdf6
commit
253896e995
@ -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)'))
|
||||||
|
Loading…
Reference in New Issue
Block a user