From 05e0638e14198d92fb5ea104a98230ec5a850f83 Mon Sep 17 00:00:00 2001 From: Ram Ramrakhya Date: Fri, 1 Oct 2021 11:27:26 -0400 Subject: [PATCH] Backend: Fix schema json loading in leaderboard update API (#3600) * Fix leaderboard schema update API * Fix tests --- apps/challenges/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/challenges/views.py b/apps/challenges/views.py index 58886a37d8..79df01ed22 100644 --- a/apps/challenges/views.py +++ b/apps/challenges/views.py @@ -2131,6 +2131,8 @@ def get_or_update_leaderboard(request, leaderboard_pk): leaderboard = get_leaderboard_model(leaderboard_pk) if request.method == "PATCH": + if "schema" in request.data.keys(): + request.data['schema'] = json.loads(request.data['schema']) serializer = LeaderboardSerializer( leaderboard, data=request.data, partial=True )