Skip to content

Commit

Permalink
apps/userdashboard: refactors moderation comment serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
hklarner committed Aug 9, 2023
1 parent f90855d commit 52e51cc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions apps/userdashboard/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ModerationCommentSerializer(serializers.ModelSerializer):
is_modified = serializers.SerializerMethodField()
last_edit = serializers.SerializerMethodField()
moderator_feedback = ModeratorCommentFeedbackSerializer(read_only=True)
num_reports = serializers.SerializerMethodField()
num_reports = serializers.IntegerField(read_only=True)
feedback_api_url = serializers.SerializerMethodField()
user_name = serializers.SerializerMethodField()
user_image = serializers.SerializerMethodField()
Expand Down Expand Up @@ -59,9 +59,6 @@ def get_last_edit(self, comment):
def get_feedback_api_url(self, comment):
return reverse("moderatorfeedback-list", kwargs={"comment_pk": comment.pk})

def get_num_reports(self, comment):
return comment.num_reports

def get_user_name(self, comment):
if comment.is_censored or comment.is_removed:
return _("unknown user")
Expand Down

0 comments on commit 52e51cc

Please sign in to comment.