rhoerbe / d-openldap-django

0 stars 0 forks source link

model.save() does not work with custom schema #1

Open rhoerbe opened 5 years ago

rhoerbe commented 5 years ago

Django-ldapdb ignores custom-defined attributes when extending inetOrgPerson. If the attribute is optional, it is not written to ldap with save(). If it is mandatory, ldap.OBJECT_CLASS_VIOLATION: {'desc': 'Object class violation', 'info': "object class 'tstPerson' requires attribute 'tstgid'"} is raised.

Steps to reproduce (requires docker-compose):

docker-compose up -d
docker-compose exec openldap_django bash
# within the container:
/test/test_all.sh

The offending test is test_tstPerson_update() in test_django_ldapdb.py

The log file up to this test is https://gist.github.com/rhoerbe/3796e4a03cbe962a8b4e67847c639a28

LennyLip commented 5 years ago

/tests/test_all.sh

LennyLip commented 5 years ago

django ldap try to rename DN before save from old to new: {'old': 'tstgid=tt1,dc=at', 'new': 'cn=testero testerossi,dc=at'}

So, it seems tstgid field should be primary_key=True.