enumerate(...,1) místo +1

This commit is contained in:
Jonas Havelka 2022-07-22 17:46:23 +02:00
parent c33896afec
commit 6dcd53b68f

View file

@ -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,