Use Django's indirection for getting the username.
This respects applications that have set User.USERNAME_FIELD to something else.
I'm experimenting with this lib in an app that uses a different field for the username, and I think this should make that work. I haven't tested this in detail locally yet, as I'm still sorting out some of the plumbing, but I'm reasonably confident this will behave as expected.
Use Django's indirection for getting the username.
This respects applications that have set User.USERNAME_FIELD to something else.
I'm experimenting with this lib in an app that uses a different field for the username, and I think this should make that work. I haven't tested this in detail locally yet, as I'm still sorting out some of the plumbing, but I'm reasonably confident this will behave as expected.