From b6e427334308f1a69b8df6ae306259de58cde55d Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sun, 7 Apr 2024 13:29:10 +0300 Subject: [PATCH] ... --- src/conf/settings.py | 22 ++++++++++++++++++++++ src/jwtauth/serializers.py | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/conf/settings.py b/src/conf/settings.py index 35923bb..8ab9504 100644 --- a/src/conf/settings.py +++ b/src/conf/settings.py @@ -193,6 +193,28 @@ CACHES = { } } +LOGGING = { + 'version': 1, + 'filters': { + 'require_debug_true': { + '()': 'django.utils.log.RequireDebugTrue', + } + }, + 'handlers': { + 'console': { + 'level': 'DEBUG', + 'filters': ['require_debug_true'], + 'class': 'logging.StreamHandler', + } + }, + 'loggers': { + 'django.db.backends': { + 'level': 'DEBUG', + 'handlers': ['console'], + } + } +} + SESSION_ENGINE = "django.contrib.sessions.backends.cache" SESSION_CACHE_ALIAS = "default" diff --git a/src/jwtauth/serializers.py b/src/jwtauth/serializers.py index cc5da7f..fefccf1 100644 --- a/src/jwtauth/serializers.py +++ b/src/jwtauth/serializers.py @@ -55,7 +55,7 @@ class LoginSerializer(serializers.Serializer): 'A password is required to log in' ) - user = authenticate(username=email, email=email, password=password) + user = authenticate(username=email, password=password) if user is None: raise serializers.ValidationError(