diff --git a/photologue/models.py b/photologue/models.py index 94b8a2e..275d8fb 100644 --- a/photologue/models.py +++ b/photologue/models.py @@ -190,7 +190,7 @@ class Gallery(models.Model): photo_set = self.photos.filter(is_public=True) else: photo_set = self.photos - return random.sample(sorted(set(photo_set)), count) + return random.sample(list(photo_set), count) def photo_count(self, public=True): """Return a count of all the photos in this gallery."""