Browse Source

treenode | UlohaVzorakNode se v treenodeeditoru zobrazuje jen orgům

export_seznamu_prednasek
Aneta Pokorná 4 years ago
parent
commit
71a2e98dda
  1. 5
      seminar/viewsets.py

5
seminar/viewsets.py

@ -90,4 +90,7 @@ class UlohaVzorakNodeViewSet(PermissionMixin, viewsets.ModelViewSet):
nazev = self.request.query_params.get('nazev',None) nazev = self.request.query_params.get('nazev',None)
if nazev is not None: if nazev is not None:
queryset = queryset.filter(nazev__contains=nazev) queryset = queryset.filter(nazev__contains=nazev)
return queryset if self.request.user.has_perm('auth.org'):
return queryset
else: # pro neorgy jen zveřejněné vzoráky
return queryset.filter(uloha__cislo_reseni__verejne_db=True)

Loading…
Cancel
Save