|
@ -18,12 +18,14 @@ class SoustredeniListView(generic.ListView): |
|
|
template_name = 'soustredeni/seznam_soustredeni.html' |
|
|
template_name = 'soustredeni/seznam_soustredeni.html' |
|
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
def get_queryset(self): |
|
|
|
|
|
if not self.request.user.je_org: |
|
|
|
|
|
return super().get_queryset() |
|
|
return ( |
|
|
return ( |
|
|
Soustredeni.objects |
|
|
Soustredeni.objects |
|
|
.prefetch_related( |
|
|
.prefetch_related( |
|
|
"ucastnici", "ucastnici__osoba", |
|
|
"ucastnici", "ucastnici__osoba", |
|
|
"organizatori", "organizatori__osoba", |
|
|
"organizatori", "organizatori__osoba", |
|
|
"galerie_set" |
|
|
"galerie_set", |
|
|
) |
|
|
) |
|
|
.select_related("rocnik") |
|
|
.select_related("rocnik") |
|
|
) |
|
|
) |
|
|