fixed expiring login creds
This commit is contained in:
@@ -77,6 +77,9 @@ class CustomTokenObtainPairSerializer(TokenObtainPairSerializer):
|
||||
if user is None or not user.check_password(password):
|
||||
raise serializers.ValidationError(_("No active account found with the given credentials"))
|
||||
|
||||
if not user.is_active:
|
||||
raise serializers.ValidationError(_("Tento účet není aktivní. Ověřte prosím svůj e-mail."))
|
||||
|
||||
# Call the parent validation to create token
|
||||
data = super().validate({
|
||||
self.username_field: user.username,
|
||||
|
||||
Reference in New Issue
Block a user