From 10b2d112496a9d9582decce79384225734b21401 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Sat, 24 Jun 2023 15:20:43 +0200 Subject: [PATCH] =?UTF-8?q?Pokus=20o=20fix=20p=C3=A1du=20webu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odevzdavatko/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/odevzdavatko/views.py b/odevzdavatko/views.py index 1e19921a..6f920474 100644 --- a/odevzdavatko/views.py +++ b/odevzdavatko/views.py @@ -433,7 +433,10 @@ class NahrajReseniView(LoginRequiredMixin, CreateView): return super().get(request, *args, **kwargs) def get_initial(self): - nadproblem_id = self.nadproblem.id + #nadproblem_id = self.nadproblem.id + # Hotfix: nevím, proč nemáme self.nadproblem, ale občas nemáme. + nadproblem_id = self.kwargs["nadproblem_id"] + self.nadproblem = get_object_or_404(m.Problem, id=nadproblem_id) return { "nadproblem_id": nadproblem_id, "problem": [] if self.nadproblem.podproblem.filter(stav=m.Problem.STAV_ZADANY).exists() else nadproblem_id