diff --git a/src/api/store/action.py b/src/api/store/action.py index c2639f6b2..9a8757f89 100644 --- a/src/api/store/action.py +++ b/src/api/store/action.py @@ -1,7 +1,7 @@ from _main_.utils.footage.FootageConstants import FootageConstants from _main_.utils.footage.spy import Spy from _main_.utils.utils import Console -from api.store.common import make_media_info +from api.store.common import get_media_info, make_media_info from api.tests.common import RESET, makeUserUpload from api.utils.api_utils import is_admin_of_community from api.utils.filter_functions import get_actions_filter_params @@ -258,6 +258,12 @@ def update_action(self, context: Context, args, user_submitted) -> Tuple[dict, M media = Media.objects.filter(id = image[0]).first() action.image = media + if action.image: + old_image_info, can_save_info = get_media_info(action.image) + if can_save_info: + action.image.user_upload.info.update({**old_image_info,**image_info}) + action.image.user_upload.save() + action.steps_to_take = steps_to_take action.deep_dive = deep_dive diff --git a/src/api/store/testimonial.py b/src/api/store/testimonial.py index 962b5d77f..8f7ea7248 100644 --- a/src/api/store/testimonial.py +++ b/src/api/store/testimonial.py @@ -1,7 +1,7 @@ from _main_.utils.footage.FootageConstants import FootageConstants from _main_.utils.footage.spy import Spy from _main_.utils.utils import Console -from api.store.common import make_media_info +from api.store.common import get_media_info, make_media_info from api.tests.common import RESET, makeUserUpload from api.utils.api_utils import is_admin_of_community from api.utils.filter_functions import get_testimonials_filter_params @@ -197,6 +197,12 @@ def update_testimonial(self, context: Context, args) -> Tuple[dict, MassEnergize testimonial.image = image makeUserUpload(media = image,info=image_info, user = testimonial.user) + if testimonial.image: + old_image_info, can_save_info = get_media_info(testimonial.image) + if can_save_info: + testimonial.image.user_upload.info.update({**old_image_info,**image_info}) + testimonial.image.user_upload.save() + if action: testimonial_action = Action.objects.filter(id=action).first() testimonial.action = testimonial_action