From 49ceaeef12ea2fc9ffad25a1d8a672dd41ecd58a Mon Sep 17 00:00:00 2001 From: MaertHaekkinen Date: Thu, 23 Nov 2023 14:33:13 +0200 Subject: [PATCH] Hide erm photos --- ajapaik/ajapaik/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ajapaik/ajapaik/models.py b/ajapaik/ajapaik/models.py index 4c91f4391..3ec005349 100644 --- a/ajapaik/ajapaik/models.py +++ b/ajapaik/ajapaik/models.py @@ -537,8 +537,14 @@ 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 2932") + + class Photo(Model): - objects = EstimatedCountManager() + objects = PhotoManager() bulk = BulkUpdateManager() # Removed sorl ImageField because of https://github.com/mariocesar/sorl-thumbnail/issues/295