From 532a80703ce120f709054b152b9d4083057b522b Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Sun, 30 Oct 2022 00:32:20 +0200
Subject: [PATCH] =?UTF-8?q?Import:=20Formul=C3=A1=C5=99=20na=20import=20?=
 =?UTF-8?q?=C3=BAloh=20um=C3=AD=20p=C5=99edvyplnit=20add/del?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 mo/web/org_contest.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mo/web/org_contest.py b/mo/web/org_contest.py
index 9722073a..6f57771b 100644
--- a/mo/web/org_contest.py
+++ b/mo/web/org_contest.py
@@ -1370,7 +1370,7 @@ def org_generic_batch_upload(task_id: int, round_id: Optional[int] = None, hier_
 
 
 class BatchPointsForm(ImportForm):
-    add_del_sols = wtforms.BooleanField('Zakládat / mazat řešení', description='Xyzzy')
+    add_del_sols = wtforms.BooleanField('Zakládat / mazat řešení')
 
 
 @app.route('/org/contest/c/<int:ct_id>/task/<int:task_id>/batch-points', methods=('GET', 'POST'))
@@ -1390,6 +1390,9 @@ def org_generic_batch_points(task_id: Optional[int] = None, round_id: Optional[i
     imp = None
     if form.validate_on_submit():
         imp = PointsImport(user=g.user, round=round, only_region=hier_place, contest=contest, task=task, allow_add_del=form.add_del_sols.data)
+    else:
+        if request.args.get('add_del', '1') == '1':
+            form.add_del_sols.data = True
     return generic_import_page(
         form, imp, ctx.url_home(),
         template='org_generic_batch_points.html',
-- 
GitLab