migrate to postgres json field

This commit is contained in:
zema1 committed 2017-10-11 21:43:29 +08:00
1 parent 93bd77d8d8
commit 080ecf1bcf
15 files changed
+315 -27

No files matched your search

+2 -2
View File
@@ -55,9 +55,9 @@ class ProblemAPI(APIView):
oi_problems_status = profile.oi_problems_status.get("problems", {})
for problem in data["results"]:
if problem["rule_type"] == ProblemRuleType.ACM:
problem["my_status"] = acm_problems_status.get(str(problem["id"]), None)
problem["my_status"] = acm_problems_status.get(str(problem["id"]), {}).get("status")
else:
problem["my_status"] = oi_problems_status.get(str(problem["id"]), None)
problem["my_status"] = oi_problems_status.get(str(problem["id"]), {}).get("status")
return self.success(data)