From 2444bb696d023f9d412bb5a4d14c5600bd93f689 Mon Sep 17 00:00:00 2001 From: hj Date: Fri, 6 Sep 2024 18:07:50 +0530 Subject: [PATCH] Add ability to add worker_img_url using yaml --- apps/challenges/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/challenges/views.py b/apps/challenges/views.py index b79e2fae41..27284f1a47 100644 --- a/apps/challenges/views.py +++ b/apps/challenges/views.py @@ -3913,6 +3913,7 @@ def create_or_update_github_challenge(request, challenge_host_team_pk): error_messages = None try: with transaction.atomic(): + worker_image_url = request.data.get("worker_image_url", None) serializer = ZipChallengeSerializer( data=yaml_file_data, context={ @@ -3925,6 +3926,7 @@ def create_or_update_github_challenge(request, challenge_host_team_pk): "github_repository": request.data[ "GITHUB_REPOSITORY" ], + "worker_image_url": worker_image_url, }, ) if serializer.is_valid(): @@ -4176,6 +4178,7 @@ def create_or_update_github_challenge(request, challenge_host_team_pk): serializer.save() # Updating Challenge object + worker_image_url = request.data.get("worker_image_url", None) serializer = ZipChallengeSerializer( challenge, data=yaml_file_data, @@ -4186,6 +4189,7 @@ def create_or_update_github_challenge(request, challenge_host_team_pk): "evaluation_script": files[ "challenge_evaluation_script_file" ], + "worker_image_url": worker_image_url, }, ) if serializer.is_valid():