This commit is contained in:
@@ -250,8 +250,9 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False):
|
|||||||
@mutation.field('delete_shout')
|
@mutation.field('delete_shout')
|
||||||
@login_required
|
@login_required
|
||||||
async def delete_shout(_, info, shout_id):
|
async def delete_shout(_, info, shout_id):
|
||||||
user_id = info.context['user_id']
|
user_id = info.context.get('user_id')
|
||||||
roles = info.context['roles']
|
roles = info.context.get('roles')
|
||||||
|
if user_id:
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
author = session.query(Author).filter(Author.user == user_id).first()
|
author = session.query(Author).filter(Author.user == user_id).first()
|
||||||
shout = session.query(Shout).filter(Shout.id == shout_id).first()
|
shout = session.query(Shout).filter(Shout.id == shout_id).first()
|
||||||
|
|||||||
Reference in New Issue
Block a user