File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 13
13
# limitations under the License.
14
14
15
15
from django .conf import settings
16
+ from django .core .exceptions import ImproperlyConfigured
16
17
from saml2 .s_utils import UnknownSystemEntity
17
18
18
19
@@ -46,7 +47,10 @@ def get_idp_sso_supported_bindings(idp_entity_id=None, config=None):
46
47
# if idp is None, assume only one exists so just use that
47
48
if idp_entity_id is None :
48
49
# .keys() returns dict_keys in python3.5+
49
- idp_entity_id = list (available_idps (config ).keys ()).pop ()
50
+ try :
51
+ idp_entity_id = list (available_idps (config ).keys ())[0 ]
52
+ except IndexError :
53
+ raise ImproperlyConfigured ("No IdP configured!" )
50
54
try :
51
55
return meta .service (idp_entity_id , 'idpsso_descriptor' , 'single_sign_on_service' ).keys ()
52
56
except UnknownSystemEntity :
You can’t perform that action at this time.
0 commit comments