From 699afeb731e2e49c20120d6a4f1032e4df5d578a Mon Sep 17 00:00:00 2001 From: Abdurrahman Asad <51022010+A-ASAD@users.noreply.github.com> Date: Fri, 18 Mar 2022 19:16:15 +0500 Subject: [PATCH] fix: flagged post banner not showing to staff (#30034) fix: flagged post banner not showing to staff --- lms/djangoapps/discussion/rest_api/serializers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/discussion/rest_api/serializers.py b/lms/djangoapps/discussion/rest_api/serializers.py index 03675d5fb9..d890046474 100644 --- a/lms/djangoapps/discussion/rest_api/serializers.py +++ b/lms/djangoapps/discussion/rest_api/serializers.py @@ -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): """