From 1bca7c9f7c18e99dd7136d8d9f354fd407b8f0a9 Mon Sep 17 00:00:00 2001 From: Rajnish Tiwari <121179385+rajnisht7@users.noreply.github.com> Date: Mon, 3 Aug 2026 12:03:44 +0530 Subject: [PATCH 1/3] Update utils.py --- drf_user/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drf_user/utils.py b/drf_user/utils.py index 8070c8c..68e2628 100644 --- a/drf_user/utils.py +++ b/drf_user/utils.py @@ -93,7 +93,7 @@ def check_unique(prop: str, value: str) -> bool: >>> print(check_unique('email', 'test@testing.com')) True """ - user = User.objects.extra(where=[prop + " = '" + value + "'"]) + user = User.objects.filter(**{prop: value}) return user.count() == 0 From c2356cb21cd8e254fa96583e6aad036a3b73bc40 Mon Sep 17 00:00:00 2001 From: Rajnish Tiwari <121179385+rajnisht7@users.noreply.github.com> Date: Mon, 3 Aug 2026 12:05:11 +0530 Subject: [PATCH 2/3] Update utils.py From 43beb80cbca4d826be394e75e73cf4f866f2564f Mon Sep 17 00:00:00 2001 From: Rajnish Tiwari <121179385+rajnisht7@users.noreply.github.com> Date: Mon, 3 Aug 2026 22:28:38 +0530 Subject: [PATCH 3/3] Update utils.py --- drf_user/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drf_user/utils.py b/drf_user/utils.py index 68e2628..9e10834 100644 --- a/drf_user/utils.py +++ b/drf_user/utils.py @@ -93,8 +93,7 @@ def check_unique(prop: str, value: str) -> bool: >>> print(check_unique('email', 'test@testing.com')) True """ - user = User.objects.filter(**{prop: value}) - return user.count() == 0 + return not User.objects.filter(**{prop: value}).exists() def generate_otp(prop: str, value: str) -> OTPValidation: