mirror of
https://git.wownero.com/wownero/YellWOWPages.git
synced 2024-08-15 01:03:25 +00:00
Merge pull request 'lower() the searches' (#4) from lowercase-search into master
Reviewed-on: https://git.wownero.com/wownero/YellWOWPages/pulls/4
This commit is contained in:
commit
1765bcdd12
2 changed files with 2 additions and 0 deletions
|
@ -23,6 +23,7 @@ class User(pw.Model):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def search(needle) -> List['User']:
|
async def search(needle) -> List['User']:
|
||||||
needle = needle.replace("*", "")
|
needle = needle.replace("*", "")
|
||||||
|
needle = needle.lower()
|
||||||
if len(needle) <= 1:
|
if len(needle) <= 1:
|
||||||
raise Exception("need longer search term")
|
raise Exception("need longer search term")
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ async def search():
|
||||||
async def user_page(name: str):
|
async def user_page(name: str):
|
||||||
if not name or len(name) <= 1:
|
if not name or len(name) <= 1:
|
||||||
raise Exception("invalid name")
|
raise Exception("invalid name")
|
||||||
|
name = name.lower()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_user = User.select().where(
|
_user = User.select().where(
|
||||||
|
|
Loading…
Reference in a new issue