From 6dcd53b68ffbce5f48ab2a512e629dd6d8cf598b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Fri, 22 Jul 2022 17:46:23 +0200 Subject: [PATCH] =?UTF-8?q?enumerate(...,1)=20m=C3=ADsto=20+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/docasne.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seminar/views/docasne.py b/seminar/views/docasne.py index d13c0016..0a9931e3 100644 --- a/seminar/views/docasne.py +++ b/seminar/views/docasne.py @@ -52,10 +52,10 @@ class HromadnePridaniView(FormView): with transaction.atomic(): pfx = f"{t.nazev}, díl {dil}, " - for k, b in enumerate(body): + for k, b in enumerate(body, 1): u = m.Uloha.objects.create( nadproblem=t, - nazev=pfx + f"{'úloha' if b > 0 else 'problém'} {k + 1}", + nazev=pfx + f"{'úloha' if b > 0 else 'problém'} {k}", autor=t.autor, garant=t.garant, max_body=b,