From d2d27657651b035dbadd46d1da920be4c1c9efbf Mon Sep 17 00:00:00 2001 From: smilerz Date: Thu, 13 Jan 2022 15:53:24 -0600 Subject: [PATCH] Update serializer.py image location should use MEDIA_URL alone and not combine with SCRIPT_NAME --- cookbook/serializer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 09520545f..48236f399 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -22,7 +22,7 @@ from cookbook.models import (Automation, BookmarkletImport, Comment, CookLog, Fo SupermarketCategoryRelation, Sync, SyncLog, Unit, UserFile, UserPreference, ViewLog) from cookbook.templatetags.custom_tags import markdown -from recipes.settings import MEDIA_URL, SCRIPT_NAME +from recipes.settings import MEDIA_URL class ExtendedRecipeMixin(serializers.ModelSerializer): @@ -56,7 +56,7 @@ class ExtendedRecipeMixin(serializers.ModelSerializer): def get_image(self, obj): if obj.recipe_image: - return SCRIPT_NAME + MEDIA_URL + obj.recipe_image + return MEDIA_URL + obj.recipe_image def count_recipes(self, obj): return Recipe.objects.filter(**{self.recipe_filter: obj}, space=obj.space).count()