adminkaga login qilish api togirlandi

This commit is contained in:
behruz-dev
2025-11-28 16:14:34 +05:00
parent 8a0e4697f0
commit 17e691ec62

View File

@@ -142,7 +142,7 @@ class AdminLoginApiView(generics.GenericAPIView, ResponseMixin):
username = serializer.validated_data.get('username')
password = serializer.validated_data.get('password')
user = User.objects.filter(username=username).first()
if not user or (user and user.check_password(password)):
if not user or (user and not user.check_password(password)):
return self.failure_response(message="username yoki parol notog'ri", data={}, status_code=404)
if not user.is_active:
return self.failure_response(message="foydalanuvchi aktive emas", data={})