Fix banned user photos appearing on Gallery

This commit is contained in:
Noah Petherbridge 2023-03-09 17:14:20 -08:00
parent df65b1b260
commit eb913844f7

View File

@ -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.