fix: flagged post banner not showing to staff (#30034)

fix: flagged post banner not showing to staff
This commit is contained in:
Abdurrahman Asad
2022-03-18 19:16:15 +05:00
committed by GitHub
parent c51a0c3e22
commit 699afeb731

View File

@@ -237,7 +237,11 @@ class _ContentSerializer(serializers.Serializer):
Returns a boolean indicating whether the requester has flagged the
content as abusive.
"""
return self.context["cc_requester"]["id"] in obj.get("abuse_flaggers", [])
total_abuse_flaggers = len(obj.get("abuse_flaggers", []))
return (
self.context["is_requester_privileged"] and total_abuse_flaggers > 0 or
self.context["cc_requester"]["id"] in obj.get("abuse_flaggers", [])
)
def get_voted(self, obj):
"""