Custom User model compatibility

From the docs: "Since the User model can be swapped out, you should use this method instead of referencing the username attribute directly."