Skip to content

Commit

Permalink
Hide some TLM and ERM photos
Browse files Browse the repository at this point in the history
  • Loading branch information
MaertHaekkinen committed Jan 8, 2024
1 parent 5643ad1 commit b54cc02
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ajapaik/ajapaik/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,16 @@ def get_album_type(self):
return Album.TYPE_CHOICES[self.atype][1]


# Ugly hack to exclude specific photos for some whiny individuals
class PhotoManager(EstimatedCountManager):
def get_queryset(self):
return super(PhotoManager, self).get_queryset().exclude(source_key__startswith="ERM Fk 2903").exclude(
source_key__startswith="TLM F 10198:")


class Photo(Model):
objects = EstimatedCountManager()
bulk = BulkUpdateManager()
objects = PhotoManager()

# Removed sorl ImageField because of https://github.com/mariocesar/sorl-thumbnail/issues/295
image = ImageField(_('Image'), upload_to='uploads', blank=True, null=True, max_length=255, height_field='height',
Expand Down

0 comments on commit b54cc02

Please sign in to comment.