Add patch for issue4383

This commit is contained in:
Sergi Almacellas Abellana 2014-12-01 19:37:25 +01:00
parent f223ef42d8
commit 603a39db0f
2 changed files with 48 additions and 0 deletions

47
issue8791002_1.diff Normal file
View file

@ -0,0 +1,47 @@
# HG changeset patch
# User Sergi Almacellas Abellana <sergi@koolpi.com>
bindname must be a string not a list
issue4383
review8791002
Index: trytond/trytond/modules/ldap_authentication/res.py
===================================================================
--- a/trytond/trytond/modules/ldap_authentication/res.py
+++ b/trytond/trytond/modules/ldap_authentication/res.py
@@ -23,9 +23,11 @@
uri.query.split('?') + [''] * 4)[:4]
if not scope:
scope = 'base'
- extensions = urlparse.parse_qs(extensions)
+ fixed_extensions = {}
+ for key, value in urlparse.parse_qs(extensions).iteritems():
+ fixed_extensions[key] = value[0]
return (uri, dn, unquote(attributes), unquote(scope), unquote(filter_),
- extensions)
+ fixed_extensions)
def ldap_connection():
Index: trytond/trytond/modules/ldap_authentication/tests/test_ldap_authentication.py
===================================================================
--- a/trytond/trytond/modules/ldap_authentication/tests/test_ldap_authentication.py
+++ b/trytond/trytond/modules/ldap_authentication/tests/test_ldap_authentication.py
@@ -85,11 +85,11 @@
self.assertEqual(
parse_ldap_url(
'ldap:///??sub??bindname=cn=Manager%2co=Foo')[5],
- {'bindname': ['cn=Manager,o=Foo']})
+ {'bindname': 'cn=Manager,o=Foo'})
self.assertEqual(
parse_ldap_url(
'ldap:///??sub??!bindname=cn=Manager%2co=Foo')[5],
- {'!bindname': ['cn=Manager,o=Foo']})
+ {'!bindname': 'cn=Manager,o=Foo'})
def suite():

1
series
View file

@ -17,3 +17,4 @@ issue5731002_1.diff
issue12691002_1.diff
issue14661002_1.diff
issue12711002_1.diff
issue8791002_1.diff