sjkingo / django_auth_ldap3

A library for connecting Django's authentication system to an LDAP directory
BSD 2-Clause "Simplified" License
23 stars 13 forks source link

Use get_user_model to determine the user model #16

Closed alandmoore closed 8 years ago

alandmoore commented 8 years ago

Instead of directly importing User from django.contrib.auth.models, use the get_user_model function to determine the configured user model.

This fixes a failure when trying to authenticate in an application that uses a custom user model.

alandmoore commented 8 years ago

Should fix issue #14

sjkingo commented 8 years ago

Nice work Alan, thank you.

Django docs suggest both AUTH_USER_MODEL and get_user_model() are supported back to at least 1.6, so happy to merge this now without further testing.