fix: allow flagging for abuse when filtering comments by user (#30346)

Abuse flagging is always supported, so allow abuse flagging even when no other
actions are available due to the lack of a thread context in the comment api.
This commit is contained in:
Kshitij Sobti
2022-09-07 12:30:45 +00:00
committed by GitHub
parent 3cd3c60b59
commit 0be6a7aa93

View File

@@ -99,8 +99,8 @@ def get_editable_fields(cc_content: Union[Thread, Comment], context: Dict) -> Se
elif context.get("thread"):
is_thread_closed = context["thread"]["closed"]
else:
# No editable fields when outside thread context
return set()
# Flagging/un-flagging is always available.
return {"abuse_flagged"}
# Map each field to the condition in which it's editable.
editable_fields = {