If I read the docs correctly this setting should be either set to "True" or to a list of groups you want to mirror: https://django-auth-ldap.readthedocs.io/en/latest/reference.html#std-setting...
I did just that. I have tried just setting it to true, using the simple names of the groups in a list, and using DN's for them in a list as well, and none of them worked.
I don't have access to LDAP at this moment, so I can't test it, but IMHO your patch looks OK and should work. Try removing the lines 533-536, restarting and re-logging.
It still didn't work, but there were no new errors after removing so thank you for that suggestion.
I get a NO_SUCH_OBJECT error whenever I log in, and the only thing matched is the dc part of a DN (e.g. DC=example,DC=com). group search and group type have been set since I otherwise wouldn't be able to use LDAP, which leaves me no other clue on how to get it to work.
I appreciate the help so far, if there is any clue to get it working in the future I would be happy to know.
Best regards, Michael