Refine
This commit is contained in:
@@ -21,13 +21,13 @@ def get_user_schema(name: str) -> dict[str, dict[str, Any]]:
|
|||||||
'password' : {'type': 'str' , 'optional': False , 'readonly': False} }
|
'password' : {'type': 'str' , 'optional': False , 'readonly': False} }
|
||||||
|
|
||||||
def get_user(name: str, user_name: str) -> dict[str, Any]:
|
def get_user(name: str, user_name: str) -> dict[str, Any]:
|
||||||
t = try_read(name, f"select * from users where name = '{user_name}'")
|
t = try_read(name, f"select * from users where username = '{user_name}'")
|
||||||
if t == None:
|
if t == None:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
d = {}
|
d = {}
|
||||||
d['id'] = str(t['id'])
|
d['id'] = str(t['id'])
|
||||||
d['name'] = str(t['name'])
|
d['name'] = str(t['username'])
|
||||||
# d['password'] = str(t['password'])
|
# d['password'] = str(t['password'])
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|||||||
Reference in New Issue
Block a user