diff --git a/apps/gallery/admin.py b/apps/gallery/admin.py index f5aa0194..e325a3ed 100644 --- a/apps/gallery/admin.py +++ b/apps/gallery/admin.py @@ -6,7 +6,7 @@ from gallery.models import Image @admin.register(Image) class ImageModelAdmin(admin.ModelAdmin): """Image model admin.""" - list_display = ['id', 'title', 'image_tag', 'orientation_display'] + list_display = ['id', 'title', 'orientation_display', 'image_tag', ] def orientation_display(self, obj): """Get image orientation name.""" diff --git a/apps/search_indexes/documents/news.py b/apps/search_indexes/documents/news.py index 6e0974d8..872d955c 100644 --- a/apps/search_indexes/documents/news.py +++ b/apps/search_indexes/documents/news.py @@ -45,8 +45,6 @@ class NewsDocument(Document): 'slug', 'state', 'is_highlighted', - 'image_url', - 'preview_image_url', 'template', ) related_models = [models.NewsType] diff --git a/apps/utils/models.py b/apps/utils/models.py index fbfd186d..fb1de17c 100644 --- a/apps/utils/models.py +++ b/apps/utils/models.py @@ -210,7 +210,7 @@ class SORLImageMixin(models.Model): def image_tag(self): """Admin preview tag.""" if self.image: - return mark_safe(f'') + return mark_safe(f'') else: return None