int-id-fix
All checks were successful
Deploy on push / deploy (push) Successful in 5m45s

This commit is contained in:
2024-02-24 21:15:11 +03:00
parent 5e72a08e0f
commit d7c9622ffa
6 changed files with 21 additions and 24 deletions

View File

@@ -45,7 +45,7 @@ def get_author(_, _info, slug='', author_id=None):
if bool(slug):
q = select(Author).where(Author.slug == slug)
if author_id:
q = select(Author).where(Author.id == int(author_id))
q = select(Author).where(Author.id == author_id)
[author, ] = get_authors_with_stat(q, ratings=True)
except Exception as exc:
@@ -204,10 +204,8 @@ def get_author_followers(_, _info, slug: str):
q = (
select(author_alias)
.join(alias_author_authors, alias_author_authors.follower == int(author_alias.id))
.join(
alias_author_followers, alias_author_followers.author == int(author_alias.id)
)
.join(alias_author_authors, alias_author_authors.follower == author_alias.id)
.join(alias_author_followers, alias_author_followers.author == author_alias.id)
.filter(author_alias.slug == slug)
.add_columns(
func.count(distinct(alias_shout_author.shout)).label('shouts_stat'),