mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
publish: 5.9.1
This commit is contained in:
parent
15996e79f7
commit
f4db47d35d
3 changed files with 10 additions and 5 deletions
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "royalnet"
|
name = "royalnet"
|
||||||
version = "5.9.0"
|
version = "5.9.1"
|
||||||
description = "A multipurpose bot and web framework"
|
description = "A multipurpose bot and web framework"
|
||||||
authors = ["Stefano Pigozzi <ste.pigozzi@gmail.com>"]
|
authors = ["Stefano Pigozzi <ste.pigozzi@gmail.com>"]
|
||||||
license = "AGPL-3.0+"
|
license = "AGPL-3.0+"
|
||||||
|
|
|
@ -36,9 +36,14 @@ class User:
|
||||||
def avatar_url(self):
|
def avatar_url(self):
|
||||||
return Column(String)
|
return Column(String)
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
async def find(alchemy, session, alias: Union[str, int]):
|
async def find(cls, alchemy, session, alias: Union[str, int]):
|
||||||
result = await ru.asyncify(session.query(alchemy.get(Alias)).filter_by(alias=alias.lower()).one_or_none)
|
if isinstance(alias, str):
|
||||||
|
result = await ru.asyncify(session.query(alchemy.get(Alias)).filter_by(alias=alias.lower()).one_or_none)
|
||||||
|
elif isinstance(alias, int):
|
||||||
|
result = await ru.asyncify(session.query(alchemy.get(cls)).get, alias)
|
||||||
|
else:
|
||||||
|
raise TypeError("alias is of an invalid type.")
|
||||||
if result is not None:
|
if result is not None:
|
||||||
result = result.user
|
result = result.user
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
semantic = "5.9.0"
|
semantic = "5.9.1"
|
||||||
|
|
Loading…
Reference in a new issue