From c72866a4eeb875e7624a4cebdb871294ad1cbf2b Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 8 Jan 2024 11:47:55 +0100 Subject: [PATCH] fix: avoid clobbering rebuttals --- fediseer/apis/v1/censures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fediseer/apis/v1/censures.py b/fediseer/apis/v1/censures.py index 255dedd..3559a34 100644 --- a/fediseer/apis/v1/censures.py +++ b/fediseer/apis/v1/censures.py @@ -176,9 +176,9 @@ class Censures(Resource): if len(censures_filtered) > 0: c_instance_details["censure_reasons"] = [censure.reason for censure in censures_filtered] c_instance_details["censure_evidence"] = [censure.evidence for censure in censures_filtered if censure.evidence is not None] - rebuttals = [r.rebuttal for r in rebuttals if r.target_id == c_instance.id] - if len(rebuttals) > 0 and not database.instance_has_flag(c_instance.id,enums.InstanceFlags.MUTED): - c_instance_details["rebuttal"] = rebuttals + rebuttals_texts = [r.rebuttal for r in rebuttals if r.target_id == c_instance.id] + if len(rebuttals_texts) > 0 and not database.instance_has_flag(c_instance.id,enums.InstanceFlags.MUTED): + c_instance_details["rebuttal"] = rebuttals_texts instance_details.append(c_instance_details) if self.args.csv: return {