Browse Source

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

okenkove_obalky
Jonas Havelka 2 years ago
parent
commit
6dcd53b68f
  1. 4
      seminar/views/docasne.py

4
seminar/views/docasne.py

@ -52,10 +52,10 @@ class HromadnePridaniView(FormView):
with transaction.atomic(): with transaction.atomic():
pfx = f"{t.nazev}, díl {dil}, " 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( u = m.Uloha.objects.create(
nadproblem=t, 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, autor=t.autor,
garant=t.garant, garant=t.garant,
max_body=b, max_body=b,

Loading…
Cancel
Save