update-fix
All checks were successful
Deploy to core / deploy (push) Successful in 1m34s

This commit is contained in:
Untone 2024-02-02 23:49:12 +03:00
parent 7cd7447796
commit b0e981ece4

View File

@ -91,6 +91,8 @@ async def create_shout(_, info, inp):
@login_required
async def update_shout(_, info, shout_id, shout_input=None, publish=False):
user_id = info.context['user_id']
if not shout_input:
shout_input = {}
with local_session() as session:
author = session.query(Author).filter(Author.user == user_id).first()
shout_dict = None
@ -109,7 +111,6 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False):
return {'error': 'shout not found'}
if shout.created_by is not author.id and author.id not in shout.authors:
return {'error': 'access denied'}
if shout_input is not None:
topics_input = shout_input['topics']
del shout_input['topics']
new_topics_to_link = [Topic(**new_topic) for new_topic in topics_input if new_topic['id'] < 0]