python3: don't use iteritems
This commit is contained in:
parent
d342971a45
commit
7df3a6f5e0
|
@ -158,7 +158,7 @@ class DefaultAdapter(object):
|
||||||
realm = utils.get_setting(idp, 'REALM')
|
realm = utils.get_setting(idp, 'REALM')
|
||||||
attribute_mapping = utils.get_setting(idp, 'ATTRIBUTE_MAPPING')
|
attribute_mapping = utils.get_setting(idp, 'ATTRIBUTE_MAPPING')
|
||||||
attribute_set = False
|
attribute_set = False
|
||||||
for field, tpl in attribute_mapping.iteritems():
|
for field, tpl in attribute_mapping.items():
|
||||||
try:
|
try:
|
||||||
value = unicode(tpl).format(realm=realm, attributes=saml_attributes, idp=idp)
|
value = unicode(tpl).format(realm=realm, attributes=saml_attributes, idp=idp)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
@ -184,7 +184,7 @@ class DefaultAdapter(object):
|
||||||
if not superuser_mapping:
|
if not superuser_mapping:
|
||||||
return
|
return
|
||||||
attribute_set = False
|
attribute_set = False
|
||||||
for key, values in superuser_mapping.iteritems():
|
for key, values in superuser_mapping.items():
|
||||||
if key in saml_attributes:
|
if key in saml_attributes:
|
||||||
if not isinstance(values, (tuple, list)):
|
if not isinstance(values, (tuple, list)):
|
||||||
values = [values]
|
values = [values]
|
||||||
|
|
|
@ -114,7 +114,7 @@ def get_idps():
|
||||||
|
|
||||||
def flatten_datetime(d):
|
def flatten_datetime(d):
|
||||||
d = d.copy()
|
d = d.copy()
|
||||||
for key, value in d.iteritems():
|
for key, value in d.items():
|
||||||
if isinstance(value, datetime.datetime):
|
if isinstance(value, datetime.datetime):
|
||||||
d[key] = value.isoformat()
|
d[key] = value.isoformat()
|
||||||
return d
|
return d
|
||||||
|
|
Loading…
Reference in New Issue