forked from Dniel97/artemis
frontend: fix namechange and password change failing
This commit is contained in:
parent
bd97428166
commit
e69149632f
@ -108,3 +108,15 @@ class UserData(BaseData):
|
|||||||
if result is None:
|
if result is None:
|
||||||
return False
|
return False
|
||||||
return result.fetchall()
|
return result.fetchall()
|
||||||
|
|
||||||
|
async def change_password(self, user_id: int, new_passwd: str) -> bool:
|
||||||
|
sql = aime_user.update(aime_user.c.id == user_id).values(password = new_passwd)
|
||||||
|
|
||||||
|
result = await self.execute(sql)
|
||||||
|
return result is not None
|
||||||
|
|
||||||
|
async def change_username(self, user_id: int, new_name: str) -> bool:
|
||||||
|
sql = aime_user.update(aime_user.c.id == user_id).values(username = new_name)
|
||||||
|
|
||||||
|
result = await self.execute(sql)
|
||||||
|
return result is not None
|
||||||
|
Loading…
Reference in New Issue
Block a user