diff --git a/pkg/models/photo.go b/pkg/models/photo.go index 8322710..b534924 100644 --- a/pkg/models/photo.go +++ b/pkg/models/photo.go @@ -270,9 +270,9 @@ func PaginateGalleryPhotos(user *User, conf Gallery, pager *Pagination) ([]*Phot placeholders = append(placeholders, filterVisibility) } - // Only certified user photos. + // Only certified (and not banned) user photos. wheres = append(wheres, - "EXISTS (SELECT 1 FROM users WHERE id = photos.user_id AND certified = true)", + "EXISTS (SELECT 1 FROM users WHERE id = photos.user_id AND certified = true AND status='active')", ) // Exclude private users' photos.