fix tests

This commit is contained in:
zema1
2017-10-21 10:51:35 +08:00
parent f5566148bc
commit d8bf33a12d
8 changed files with 80 additions and 46 deletions

View File

@@ -223,6 +223,7 @@ class ProblemAPI(APIView):
data["total_score"] = total_score
# todo check filename and score info
tags = data.pop("tags")
data["languages"] = list(data["languages"])
for k, v in data.items():
setattr(problem, k, v)

View File

@@ -71,10 +71,8 @@ class ProblemAPI(APIView):
class ContestProblemAPI(APIView):
def _add_problem_status(self, request, queryset_values):
print("checking")
if self.contest.rule_type == ContestRuleType.OI and not self.contest.check_oi_permission(request.user):
return
print('here')
if request.user.is_authenticated():
profile = request.user.userprofile
if self.contest.rule_type == ContestRuleType.ACM: