mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
[Fix] Forum Reply return Error
This commit is contained in:
parent
07bf2e2fe7
commit
0fac47b39e
@ -171,7 +171,11 @@ class ForumReplyAPI(APIView):
|
||||
content=data["content"],
|
||||
floor=floor,
|
||||
author=request.user)
|
||||
return self.success(ForumReplySerializer(forumreply).data)
|
||||
data = ForumReplySerializer(forumreply).data
|
||||
user = User.objects.get(username=data["author"]["username"], is_disabled=False)
|
||||
userprofile = UserProfileSerializer(user.userprofile, show_real_name=False).data
|
||||
data["author"].update({"grade": userprofile["grade"], "title": userprofile["user"]["title"], "title_color": userprofile["user"]["title_color"]})
|
||||
return self.success(data)
|
||||
|
||||
def get(self, request):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user