Commit b0a09969 authored by PCoder's avatar PCoder

Refactor LDAP_USER_DN to .env

parent 7131ed6d
......@@ -226,6 +226,8 @@ LDAP_DEFAULT_START_UID = config(
'LDAP_DEFAULT_START_UID', cast=int, default=10000
)
LDAP_USER_DN = config('LDAP_USER_DN', default='ou=users,dc=ungleich,dc=ch')
if config('ENABLE_DEBUG_LOG', cast=bool, default=False):
loggers_dict = {}
MODULES_TO_LOG = config('MODULES_TO_LOG', 'django')
......
......@@ -37,7 +37,7 @@ def create_user(user, password, firstname, lastname, email):
logger.debug("{uid} does not exist. Using it".format(uid=uidNumber))
set_max_uid(uidNumber)
w = Writer(conn, obj_new_user)
dn = 'uid=%s,ou=users,dc=ungleich,dc=ch' % user
dn = 'uid=%s,%s' % (user, settings.LDAP_USER_DN)
w.new(dn)
w[0].givenName = firstname
w[0].sn = lastname
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment