aboutsummaryrefslogtreecommitdiffstats
path: root/modules/transifex/files/custom_backend.py
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2010-12-15 21:24:26 +0000
committerMichael Scherer <misc@mageia.org>2010-12-15 21:24:26 +0000
commitc41357a607659099be05c5ada092cf343b08560c (patch)
tree87f49f61cea32e31422d8ae14c50aaeae206d8c5 /modules/transifex/files/custom_backend.py
parentdb6bb8f84629ddac88b1e658da946a3f595e013f (diff)
downloadpuppet-c41357a607659099be05c5ada092cf343b08560c.tar
puppet-c41357a607659099be05c5ada092cf343b08560c.tar.gz
puppet-c41357a607659099be05c5ada092cf343b08560c.tar.bz2
puppet-c41357a607659099be05c5ada092cf343b08560c.tar.xz
puppet-c41357a607659099be05c5ada092cf343b08560c.zip
allow to use email on log on transifex
Diffstat (limited to 'modules/transifex/files/custom_backend.py')
-rw-r--r--modules/transifex/files/custom_backend.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/transifex/files/custom_backend.py b/modules/transifex/files/custom_backend.py
new file mode 100644
index 00000000..828744fb
--- /dev/null
+++ b/modules/transifex/files/custom_backend.py
@@ -0,0 +1,9 @@
+
+from django_auth_ldap.backend import LDAPBackend,_LDAPUser
+
+class ForceUidLDAPBackend(LDAPBackend):
+ def ldap_to_django_username(self, username):
+ # force uid if someone give a email
+ return _LDAPUser(self, username=username).attrs['uid'][0]
+
+