mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +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]
|
||||
name = "royalnet"
|
||||
version = "5.9.0"
|
||||
version = "5.9.1"
|
||||
description = "A multipurpose bot and web framework"
|
||||
authors = ["Stefano Pigozzi <ste.pigozzi@gmail.com>"]
|
||||
license = "AGPL-3.0+"
|
||||
|
|
|
@ -36,9 +36,14 @@ class User:
|
|||
def avatar_url(self):
|
||||
return Column(String)
|
||||
|
||||
@staticmethod
|
||||
async def find(alchemy, session, alias: Union[str, int]):
|
||||
result = await ru.asyncify(session.query(alchemy.get(Alias)).filter_by(alias=alias.lower()).one_or_none)
|
||||
@classmethod
|
||||
async def find(cls, alchemy, session, alias: Union[str, int]):
|
||||
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:
|
||||
result = result.user
|
||||
return result
|
||||
|
|
|
@ -1 +1 @@
|
|||
semantic = "5.9.0"
|
||||
semantic = "5.9.1"
|
||||
|
|
Loading…
Reference in a new issue