diff options
Diffstat (limited to 'gn_auth/auth/authorisation/resources/groups/models.py')
-rw-r--r-- | gn_auth/auth/authorisation/resources/groups/models.py | 7 |
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 ?"), |