- cursor = ldapdb.connection._cursor()
- for dn in [LdapGroup.base_dn, LdapUser.base_dn]:
- rdn = dn.split(',')[0]
+ for model in [LdapGroup, LdapUser]:
+ using = router.db_for_write(model)
+ connection = connections[using]
+
+ rdn = model.base_dn.split(',')[0]