diff options
author | Frederick Muriuki Muriithi | 2025-06-24 13:27:29 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-06-24 13:27:29 -0500 |
commit | 338ffb2c0a173ffce4ed9b709fa81bb98dced793 (patch) | |
tree | f7c05d59916c1faf993efcde3149ce32898d7817 /gn_auth | |
parent | 8ad7019b381e618eb7d5e2bb36b4fd7ed19759a5 (diff) | |
download | gn-auth-338ffb2c0a173ffce4ed9b709fa81bb98dced793.tar.gz |
Search in names too. Fix query params.
Diffstat (limited to 'gn_auth')
-rw-r--r-- | gn_auth/auth/authorisation/users/models.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gn_auth/auth/authorisation/users/models.py b/gn_auth/auth/authorisation/users/models.py index b18c5dc..ef3ce7f 100644 --- a/gn_auth/auth/authorisation/users/models.py +++ b/gn_auth/auth/authorisation/users/models.py @@ -46,7 +46,11 @@ def __list_user_clauses_and_params__(**kwargs) -> tuple[list[str], dict[str, Uni params = {} if bool(kwargs.get("email", "").strip()): clauses = clauses + ["email LIKE :email"] - params["email"] = kwargs["email"].strip() + params["email"] = f'%{kwargs["email"].strip()}%' + + if bool(kwargs.get("name", "").strip()): + clauses = clauses + ["name LIKE :name"] + params["name"] = f'%{kwargs["name"].strip()}%' if bool(kwargs.get("verified", "").strip()): clauses = clauses + ["verified=:verified"] |