Fix banned user photos appearing on Gallery

face-detect
Noah Petherbridge 2023-03-09 17:14:20 -08:00
parent df65b1b260
commit eb913844f7
1 changed files with 2 additions and 2 deletions

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.