From d7ce4c928370f000f6ae87d4a91aef3ee9176cf9 Mon Sep 17 00:00:00 2001 From: dsc Date: Thu, 17 Mar 2022 09:13:31 +0200 Subject: [PATCH] lower() the searches --- yellow/models.py | 1 + yellow/routes.py | 1 + 2 files changed, 2 insertions(+) diff --git a/yellow/models.py b/yellow/models.py index 4022d62..530c9be 100644 --- a/yellow/models.py +++ b/yellow/models.py @@ -23,6 +23,7 @@ class User(pw.Model): @staticmethod async def search(needle) -> List['User']: needle = needle.replace("*", "") + needle = needle.lower() if len(needle) <= 1: raise Exception("need longer search term") diff --git a/yellow/routes.py b/yellow/routes.py index 233f90e..608bdd3 100644 --- a/yellow/routes.py +++ b/yellow/routes.py @@ -74,6 +74,7 @@ async def search(): async def user_page(name: str): if not name or len(name) <= 1: raise Exception("invalid name") + name = name.lower() try: _user = User.select().where(