more-instance-check
All checks were successful
Deploy to core / deploy (push) Successful in 2m8s

This commit is contained in:
Untone 2024-02-15 18:17:18 +03:00
parent e9ed01e797
commit 233c71385f

View File

@ -45,7 +45,7 @@ async def create_shout(_, info, inp):
user_id = info.context['user_id']
with local_session() as session:
author = session.query(Author).filter(Author.user == user_id).first()
if author:
if isinstance(author, Author):
current_time = int(time.time())
slug = inp.get('slug') or f'draft-{current_time}'
shout_dict = {
@ -168,7 +168,7 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False):
with local_session() as session:
author = session.query(Author).filter(Author.user == user_id).first()
current_time = int(time.time())
if author:
if isinstance(author, Author):
shout = (
session.query(Shout)
.options(