Pokus o fix pádu webu
This commit is contained in:
parent
01ad1daba9
commit
10b2d11249
1 changed files with 4 additions and 1 deletions
|
@ -433,7 +433,10 @@ class NahrajReseniView(LoginRequiredMixin, CreateView):
|
||||||
return super().get(request, *args, **kwargs)
|
return super().get(request, *args, **kwargs)
|
||||||
|
|
||||||
def get_initial(self):
|
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 {
|
return {
|
||||||
"nadproblem_id": nadproblem_id,
|
"nadproblem_id": nadproblem_id,
|
||||||
"problem": [] if self.nadproblem.podproblem.filter(stav=m.Problem.STAV_ZADANY).exists() else nadproblem_id
|
"problem": [] if self.nadproblem.podproblem.filter(stav=m.Problem.STAV_ZADANY).exists() else nadproblem_id
|
||||||
|
|
Loading…
Reference in a new issue