From a28b599f893057aca96270fd138bd1042f8d4a8c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 23 Feb 2011 16:47:12 +0000 Subject: finish the move to django_application common class --- modules/django_application/files/custom_backend.py | 9 +++++++++ modules/transifex/files/custom_backend.py | 9 --------- modules/transifex/manifests/init.pp | 14 ++------------ 3 files changed, 11 insertions(+), 21 deletions(-) create mode 100644 modules/django_application/files/custom_backend.py delete mode 100644 modules/transifex/files/custom_backend.py (limited to 'modules') diff --git a/modules/django_application/files/custom_backend.py b/modules/django_application/files/custom_backend.py new file mode 100644 index 00000000..828744fb --- /dev/null +++ b/modules/django_application/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] + + diff --git a/modules/transifex/files/custom_backend.py b/modules/transifex/files/custom_backend.py deleted file mode 100644 index 828744fb..00000000 --- a/modules/transifex/files/custom_backend.py +++ /dev/null @@ -1,9 +0,0 @@ - -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] - - diff --git a/modules/transifex/manifests/init.pp b/modules/transifex/manifests/init.pp index d3d2ead2..1a643871 100644 --- a/modules/transifex/manifests/init.pp +++ b/modules/transifex/manifests/init.pp @@ -1,6 +1,6 @@ class transifex { - - package { ['transifex','python-psycopg2','python-django-auth-ldap']: + include django_application + package { 'transifex': ensure => installed } @@ -74,16 +74,6 @@ class transifex { notify => Service['apache'] } - file { "custom_backend.py": - path => "/usr/local/lib/custom_backend.py", - ensure => present, - owner => root, - group => root, - mode => 644, - source => "puppet:///modules/transifex/custom_backend.py", - notify => Service['apache'] - } - subversion::snapshot { $templates_dir: source => "svn://svn.mageia.org/svn/web/templates/transifex/trunk" } -- cgit v1.2.1