From ddda7052ae1b619c47aef27fbacd18a4a11e17c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Fri, 2 Aug 2024 19:17:11 +0200 Subject: [PATCH] =?UTF-8?q?Zbaven=C3=AD=20se=20zbyte=C4=8Dn=C3=A9ho=20impo?= =?UTF-8?q?rtu=20modelu=20Resitel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soustredeni/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/soustredeni/views.py b/soustredeni/views.py index 6ec8c36c..2022adba 100644 --- a/soustredeni/views.py +++ b/soustredeni/views.py @@ -13,7 +13,6 @@ import http from seminar.views import obalkyView from .models import Soustredeni, Soustredeni_Ucastnici -from personalni.models import Resitel from various.models import Nastaveni @@ -66,7 +65,7 @@ class SoustredeniUcastniciView(SoustredeniUcastniciBaseView): def soustredeniUcastniciExportView(request, soustredeni): soustredeni = get_object_or_404(Soustredeni, id=soustredeni) - ucastnici = Resitel.objects.filter(soustredeni=soustredeni) + ucastnici = soustredeni.ucastnici.all() response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="ucastnici.csv"' @@ -79,7 +78,7 @@ def soustredeniUcastniciExportView(request, soustredeni): def soustredeniStvrzenkyView(request, soustredeni): soustredeni = get_object_or_404(Soustredeni, id=soustredeni) - ucastnici = Resitel.objects.filter(soustredeni=soustredeni) + ucastnici = soustredeni.ucastnici.all() if ucastnici.count() == 0: return HttpResponse( render(request, 'universal.html', {