Commits

Guilherme Gondim  committed fcdb470

fix views to select only public albums and pictures

  • Participants
  • Parent commits 94317c5

Comments (0)

Files changed (2)

File galeria/models.py

 
     @property
     def ordered_pictures(self):
-        return self.pictures.order_by(self.order)
+        return self.pictures.public().order_by(self.order)
 
     def get_album_tree(self):
         tree = [self.slug]

File galeria/views.py

 
 class AlbumDetail(generic.detail.DetailView):
     model = Album
+    queryset = Album.objects.public()
 
 
 class AlbumList(generic.list.ListView):
     model = Album
+    queryset = Album.objects.public()
     paginate_by = 20
 
 
 class PictureDetail(generic.detail.DetailView):
     model = Picture
+    queryset = Picture.objects.public()