Skip to content

Commit

Permalink
copyright edit setup for actions and testimonials now working tooo
Browse files Browse the repository at this point in the history
  • Loading branch information
frimpongopoku committed Oct 13, 2023
1 parent f847995 commit cdfd7ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/api/store/action.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion src/api/store/testimonial.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cdfd7ad

Please sign in to comment.