less-scope-exception-4

This commit is contained in:
Untone 2024-03-05 14:45:53 +03:00
parent cc3e7b982b
commit 16c425fd5e

View File

@ -74,7 +74,8 @@ async def get_shout(_, info, slug=None, shout_id=None):
logger.debug(f'{user_id} is getting shout which is not published yet') logger.debug(f'{user_id} is getting shout which is not published yet')
logger.debug(f'roles: {roles}') logger.debug(f'roles: {roles}')
author = session.query(Author).filter(Author.user == user_id).first() author = session.query(Author).filter(Author.user == user_id).first()
if not isinstance(author, Author): logger.debug(author)
if not author:
logger.warn('author is not found') logger.warn('author is not found')
raise HTTPException( raise HTTPException(
status_code=401, detail='shout is not published yet' status_code=401, detail='shout is not published yet'