fix #539 where user.is_active was ignored for social login

This commit is contained in:
olivierdalang 2019-05-24 00:48:10 +02:00
parent 624ad01afb
commit b3c91dfda7

View File

@ -142,6 +142,9 @@ class SocialLoginSerializer(serializers.Serializer):
login.lookup() login.lookup()
login.save(request, connect=True) login.save(request, connect=True)
if not login.user.is_active:
raise serializers.ValidationError(_('User account is disabled.'))
attrs['user'] = login.account.user attrs['user'] = login.account.user
return attrs return attrs