Upgrade odevzdavatka #30
1 changed files with 7 additions and 0 deletions
|
@ -403,6 +403,13 @@ class NahrajReseniView(LoginRequiredMixin, CreateView):
|
|||
form_class = f.NahrajReseniForm
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
# Zaříznutí nezadaných problémů
|
||||
nadproblem_id = self.kwargs["nadproblem_id"]
|
||||
nadproblem = get_object_or_404(m.Problem, id=nadproblem_id)
|
||||
if nadproblem.stav != "zadany":
|
||||
raise PermissionDenied()
|
||||
|
||||
|
||||
# Zaříznutí starých řešitelů:
|
||||
# FIXME: Je to tady dost naprasené, mělo by to asi být jinde…
|
||||
osoba = m.Osoba.objects.get(user=self.request.user)
|
||||
|
|
Loading…
Reference in a new issue