From 50e887f3cea25733933a82cb6ad5708087c7ac24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 16 Nov 2021 10:04:21 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20=C5=99e=C5=A1itelsk=C3=A9=20=C5=99e=C5=A1?= =?UTF-8?q?en=C3=AD=20omezen=C3=AD=20p=C5=99=C3=ADstupu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/odevzdavatko.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seminar/views/odevzdavatko.py b/seminar/views/odevzdavatko.py index 786d263c..b3e1947d 100644 --- a/seminar/views/odevzdavatko.py +++ b/seminar/views/odevzdavatko.py @@ -289,7 +289,7 @@ class ResitelReseniView(DetailView): def get_context_data(self, **kw): ctx = super().get_context_data(**kw) hodnoceni = self.aktualni_hodnoceni() - if self.request.user not in self.reseni.resitele.all(): + if not self.reseni.resitele.filter(osoba__user=self.request.user).exists(): raise PermissionDenied() # ctx['poznamka'] = f.PoznamkaReseniForm(instance=self.reseni) ctx["hodnoceni"] = hodnoceni