Odevzdávátko: Osamocený nadproblém se vybere automaticky
This commit is contained in:
parent
dee1b2bb2c
commit
92cb8ec206
1 changed files with 6 additions and 1 deletions
|
@ -416,7 +416,12 @@ class NahrajReseniView(LoginRequiredMixin, CreateView):
|
||||||
return super().get(request, *args, **kwargs)
|
return super().get(request, *args, **kwargs)
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
return {"nadproblem_id": self.kwargs["nadproblem_id"]}
|
nadproblem_id = self.kwargs["nadproblem_id"]
|
||||||
|
return {
|
||||||
|
"nadproblem_id": nadproblem_id,
|
||||||
|
"problem": [] if m.Problem.objects.filter(stav=m.Problem.STAV_ZADANY, nadproblem__id=nadproblem_id) else nadproblem_id
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
def get_context_data(self,**kwargs):
|
def get_context_data(self,**kwargs):
|
||||||
data = super().get_context_data(**kwargs)
|
data = super().get_context_data(**kwargs)
|
||||||
|
|
Loading…
Reference in a new issue