From: deyk Date: Wed, 18 Apr 2012 17:59:18 +0000 (-0700) Subject: Instead of checking for list type, check for collections.Iterable type. X-Git-Tag: 22.4~21 X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/commitdiff_plain/59b906fd2d60bd4a8712c23796a3ccfecbf5c5ad Instead of checking for list type, check for collections.Iterable type. --- diff --git a/cas_provider/attribute_formatters.py b/cas_provider/attribute_formatters.py index a04828d..d61af0f 100644 --- a/cas_provider/attribute_formatters.py +++ b/cas_provider/attribute_formatters.py @@ -1,4 +1,5 @@ from lxml import etree +import collections CAS_URI = 'http://www.yale.edu/tp/cas' NSMAP = {'cas': CAS_URI} @@ -10,7 +11,7 @@ def jasig(auth_success, attrs): style = etree.SubElement(attributes, CAS + 'attraStyle') style.text = u'Jasig' for name, value in attrs.items(): - if isinstance(value, list): + if isinstance(value, collections.Iterable): for e in value: element = etree.SubElement(attributes, CAS + name) element.text = e