summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2014-09-04 18:11:40 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2014-10-31 17:36:42 (GMT)
commit90dd5d0389865c64e49c251b7ffafde64348dfe0 (patch)
treec45d1f645d89958c405dcffcc3cb82833b96fbd5
parenta06c0a5fcdadb33fee5c4aaa3679e4bbf786255f (diff)
downloadportail-citoyen-90dd5d0389865c64e49c251b7ffafde64348dfe0.zip
portail-citoyen-90dd5d0389865c64e49c251b7ffafde64348dfe0.tar.gz
portail-citoyen-90dd5d0389865c64e49c251b7ffafde64348dfe0.tar.bz2
Do not delete uncreated provider in WcsInstancePortailCitoyenAdmin
-rw-r--r--portail_citoyen/admin.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/portail_citoyen/admin.py b/portail_citoyen/admin.py
index 544763b..75d95e6 100644
--- a/portail_citoyen/admin.py
+++ b/portail_citoyen/admin.py
@@ -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()