summaryrefslogtreecommitdiffstats
path: root/virtualenv/pffedportal
diff options
context:
space:
mode:
authorThomas NOEL <tnoel@entrouvert.com>2013-03-26 16:10:20 (GMT)
committerThomas NOEL <tnoel@entrouvert.com>2013-03-26 16:10:20 (GMT)
commitc2fc71df2ec845bc72c40cc6e3ecca7291f3ed41 (patch)
tree4cf8cb0021c2cff4598b3e4c5c44f2a94fa824ed /virtualenv/pffedportal
parentc399dda2bb469e009b4f79316dee4da07b8871f5 (diff)
downloadunivnautes-old-c2fc71df2ec845bc72c40cc6e3ecca7291f3ed41.zip
univnautes-old-c2fc71df2ec845bc72c40cc6e3ecca7291f3ed41.tar.gz
univnautes-old-c2fc71df2ec845bc72c40cc6e3ecca7291f3ed41.tar.bz2
default_idp fix
Diffstat (limited to 'virtualenv/pffedportal')
-rw-r--r--virtualenv/pffedportal/base/views.py5
-rw-r--r--virtualenv/pffedportal/templates/login0.html2
2 files changed, 6 insertions, 1 deletions
diff --git a/virtualenv/pffedportal/base/views.py b/virtualenv/pffedportal/base/views.py
index 8b1efc9..1aabebe 100644
--- a/virtualenv/pffedportal/base/views.py
+++ b/virtualenv/pffedportal/base/views.py
@@ -94,7 +94,10 @@ def login(request):
prefered_idp = request.COOKIES.get('prefered_idp', settings.DEFAULT_IDP)
default_idp = saml_models.LibertyProvider.objects.get(entity_id=prefered_idp)
except:
- default_idp = None
+ try:
+ default_idp = saml_models.LibertyProvider.objects.get(entity_id=settings.DEFAULT_IDP)
+ except:
+ default_idp = None
register_next_target(request, url='/')
if settings.EMAIL_RCPT and settings.EMAIL_HOST:
mailform = True
diff --git a/virtualenv/pffedportal/templates/login0.html b/virtualenv/pffedportal/templates/login0.html
index 10bea3e..969f8c9 100644
--- a/virtualenv/pffedportal/templates/login0.html
+++ b/virtualenv/pffedportal/templates/login0.html
@@ -29,6 +29,7 @@
</div>
{% endif %}
+ {% if default_idp %}
<div class="well sidebar-nav" id="defaultidp">
<ul class="nav nav-list">
<li data-entityid="default_idp.entity_id">
@@ -37,6 +38,7 @@
</li>
</ul>
</div>
+ {% endif %}
<p>
<input class="span12" id="search" type="text" placeholder="Chercher dans la listeā€¦">