From 3d0d6a04850031bc53e1b8daaf7c3a73b14aaa9c Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 10 Oct 2018 22:04:22 +0200 Subject: add_task: fix reference to instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python 3’s exec does not import symbols into the current namespace. --- kpov_judge/add_task.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'kpov_judge') diff --git a/kpov_judge/add_task.py b/kpov_judge/add_task.py index 76eb2ae..7839cce 100755 --- a/kpov_judge/add_task.py +++ b/kpov_judge/add_task.py @@ -95,10 +95,8 @@ if __name__ == '__main__': {'$set': {'source': gen_params_source}}, upsert=True) db.task_params_meta.update({'task_id': task_id, 'class_id': class_id}, {'$set': {'params': d['params_meta']}}, upsert=True) - #instructions = dict([(k, v.encode('utf8')) for k, v in instructions.iteritems()]) - #print instructions db.task_instructions.update({'task_id': task_id, 'class_id': class_id}, - {'$set': instructions}, upsert=True) + {'$set': d['instructions']}, upsert=True) for howto_dir in glob.glob(os.path.join(dirname, 'howtos/*')): howto_lang = os.path.basename(os.path.normpath(howto_dir)) if howto_lang not in {'images'}: -- cgit v1.2.1