移除time_zone,修复problem越权

This commit is contained in:
zemal
2017-08-23 17:01:55 +08:00
parent 99fd87dbcf
commit 57ab7435af
10 changed files with 34 additions and 31 deletions

View File

@@ -89,9 +89,10 @@ class ContestAccessAPI(APIView):
class ContestRankAPI(APIView):
def get_rank(self):
if self.contest.contest_type == ContestRuleType.ACM:
if self.contest.rule_type == ContestRuleType.ACM:
rank = ACMContestRank.objects.filter(contest=self.contest). \
select_related("user").order_by("-total_ac_number", "total_time")
print(rank)
return ACMContestRankSerializer(rank, many=True).data
else:
rank = OIContestRank.objects.filter(contest=self.contest). \