Skip to content

Commit cc9552a

Browse files
committed
update for accept login users of CustomUserModel objects where doesn't exist username field and setted USERNAME_FIELD property
1 parent 7c8a34f commit cc9552a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_auth/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def validate(self, attrs):
8181
# Authentication without using allauth
8282
if email:
8383
try:
84-
username = UserModel.objects.get(email__iexact=email).username
84+
username = UserModel.objects.get(email__iexact=email).get_username()
8585
except UserModel.DoesNotExist:
8686
pass
8787

0 commit comments

Comments
 (0)