-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Sometimes users create albums but do not upload images (sometimes they do it later). Though empty albums are not displayed to non-owner, they are still included in queryset in AlbumListView. Thus, e.g., if IMAGESTORE_ALBUMS_ON_PAGE = 12 and one of albums has no images (and therefore no head) and non-owner opens imagestore:index page, there will be only 11 albums on page.
By this reason some precisely built pages are displayed not very neat way. I suggest excluding such albums from queryset (to insert before return albums):
if self.request.user.is_authenticated():
albums = albums.exclude(Q(head__isnull=True), ~Q(user=self.request.user))
else:
albums = albums.exclude(head__isnull=True)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels