migrate to postgres json field

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

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)