Do not delete uncreated provider in WcsInstancePortailCitoyenAdmin

This commit is contained in:
Benjamin Dauvergne 2014-09-04 20:11:40 +02:00 committed by Frédéric Péters
parent a06c0a5fcd
commit 90dd5d0389
1 changed files with 2 additions and 1 deletions

View File

@ -173,8 +173,9 @@ if 'wcsinst.wcsinst' in settings.INSTALLED_APPS:
try:
provider.clean()
except ValidationError, v:
provider.delete()
logger.error('Unable to create the SAML 2.0 provider: %r', v)
if provider.id:
provider.delete()
messages.error(request, _('Unable to create the SAML 2.0 provider: %s') % v)
break
provider.save()