From 2e5a4d93c381d2e2598447cc6e163cf90655dc36 Mon Sep 17 00:00:00 2001 From: vmonakhov Date: Sat, 30 Nov 2024 12:14:56 +0300 Subject: [PATCH] now tsakorpus requires administrator for force mode only --- lingvodoc/schema/query.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lingvodoc/schema/query.py b/lingvodoc/schema/query.py index 3d931f39..78e17521 100644 --- a/lingvodoc/schema/query.py +++ b/lingvodoc/schema/query.py @@ -8650,14 +8650,15 @@ def mutate(root, info, **args): client_id = info.context.get('client_id') client = DBSession.query(Client).filter_by(id=client_id).first() - if not client or client.user_id != 1: + force = args.get('force', False) + + if force and (not client or client.user_id != 1): return ( ResponseError( message='Not an administrator.')) perspective_id = args.get('perspective_id') - force = args.get('force', False) debug_flag = args.get('debug_flag', False) # Processing a single perspective.