You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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 nohead
) and non-owner opensimagestore: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
):The text was updated successfully, but these errors were encountered: