From 07964b7c7f942c4acfb7082a5bbedb2fa70444b5 Mon Sep 17 00:00:00 2001 From: MaertHaekkinen Date: Mon, 8 Jul 2024 22:51:26 +0300 Subject: [PATCH] Soft delete improvements --- ajapaik/ajapaik/migrations/0026_photo_soft_deleted.py | 2 +- ajapaik/ajapaik/models.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ajapaik/ajapaik/migrations/0026_photo_soft_deleted.py b/ajapaik/ajapaik/migrations/0026_photo_soft_deleted.py index 7f64f8004..c62d65dc3 100644 --- a/ajapaik/ajapaik/migrations/0026_photo_soft_deleted.py +++ b/ajapaik/ajapaik/migrations/0026_photo_soft_deleted.py @@ -12,6 +12,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='photo', name='soft_deleted', - field=models.BooleanField(default=False, help_text='Hide image from being accessed outside of Admin'), + field=models.BooleanField(default=False, help_text='Hide image from being accessed, even in ADMIN!'), ), ] diff --git a/ajapaik/ajapaik/models.py b/ajapaik/ajapaik/models.py index 690be9a4d..a8f17e99d 100644 --- a/ajapaik/ajapaik/models.py +++ b/ajapaik/ajapaik/models.py @@ -545,7 +545,7 @@ def get_queryset(self): class Photo(Model): - objects = EstimatedCountManager() + 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', @@ -659,7 +659,8 @@ class Photo(Model): viewpoint_elevation = PositiveSmallIntegerField(_('Viewpoint elevation'), choices=VIEWPOINT_ELEVATION_CHOICES, blank=True, null=True) description_original_language = CharField(_('Description original language'), max_length=255, blank=True, null=True) - soft_deleted = BooleanField(default=False, help_text=_("Hide image from being accessed outside of Admin")) + # TODO: Migrate to use proxy model for admin + soft_deleted = BooleanField(default=False, help_text=_("Hide image from being accessed, even in ADMIN!")) original_lat = None original_lon = None