aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/resources/groups/models.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-07-09 08:36:42 -0500
committerFrederick Muriuki Muriithi2025-07-09 09:02:38 -0500
commit360cc3bd259c5e1c123bf8095d8474213597971d (patch)
treef845d603268ecefdf5975829691ac475005ae7fb /gn_auth/auth/authorisation/resources/groups/models.py
parentfb1e138b3efbd22eca59f2d8f836c1e61121c964 (diff)
downloadgn-auth-360cc3bd259c5e1c123bf8095d8474213597971d.tar.gz
Fix some linting issues.
Diffstat (limited to 'gn_auth/auth/authorisation/resources/groups/models.py')
-rw-r--r--gn_auth/auth/authorisation/resources/groups/models.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gn_auth/auth/authorisation/resources/groups/models.py b/gn_auth/auth/authorisation/resources/groups/models.py
index b8a5235..1d44ca4 100644
--- a/gn_auth/auth/authorisation/resources/groups/models.py
+++ b/gn_auth/auth/authorisation/resources/groups/models.py
@@ -237,9 +237,12 @@ def is_group_leader(conn: db.DbConnection, user: User, group: Group) -> bool:
return "group-leader" in role_names
-def __build_groups_list_query__(base: str, search: Optional[str] = None) -> tuple[str, tuple[Optional[str], ...]]:
+def __build_groups_list_query__(
+ base: str,
+ search: Optional[str] = None
+) -> tuple[str, tuple[Optional[str], ...]]:
"""Build up the query from given search terms."""
- if bool(search):
+ if search is not None and search.strip() != "":
_search = search.strip()
return ((f"{base} WHERE groups.group_name LIKE ? "
"OR groups.group_metadata LIKE ?"),