mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
[Fix] Contest Rank User's Title
This commit is contained in:
parent
c137e0b2d4
commit
07bf2e2fe7
@ -192,6 +192,6 @@ class ContestRankAPI(APIView):
|
||||
page_qs["results"] = serializer(page_qs["results"], many=True, is_contest_admin=is_contest_admin).data
|
||||
for i in range(0, len(page_qs["results"])):
|
||||
user = User.objects.get(username=page_qs["results"][i]["user"]["username"], is_disabled=False)
|
||||
grade = UserProfileSerializer(user.userprofile, show_real_name=True).data["grade"]
|
||||
page_qs["results"][i]["user"].update({"grade": grade})
|
||||
userprofile = UserProfileSerializer(user.userprofile, show_real_name=True).data
|
||||
page_qs["results"][i].update({"grade": userprofile["grade"], "title": userprofile["user"]["title"], "title_color": userprofile["user"]["title_color"]})
|
||||
return self.success(page_qs)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user