From nobody Wed Apr 24 07:38:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555495800; cv=none; d=zoho.com; s=zohoarc; b=hxTp1ieO94US25I1bmfmgyZ2JIW71oNe5cNa0a7UDoWnUpakjjP5PToG/NO0nnujFvHgHcxRH/rdMoPOhw9dQxn+1gM2YoiS4wxUzm+Fm85BzHSbSwcBVncZDIVHbugJQDVo/4Hw+9PWcK42zAedG0KTofK1LAFvF9zXtoDKReM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555495800; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ZKwlyl9LZYPRNyDXBsCidq7Y3Z9RFwWYgXTUtc/32cE=; b=mdvGeJ/gGI8CA9xnJdpmDXfM3KjH6+iMd/OP170KNbPybwtkql/+3OCRmCPxdmhMtqOF/jljoU3i/kfrJ86zEsNBsnYiITrwN2G+ks70C+eWF2GQvn4ZwyC9zbO92m0oxw9HF4uo82+5VFOZxPN+DPdfYm2R42IbvYb5ia9E5r0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1555495800173793.6431377873535; Wed, 17 Apr 2019 03:10:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E190B308AA12; Wed, 17 Apr 2019 10:09:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2CC6600CC; Wed, 17 Apr 2019 10:09:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C718D41F3D; Wed, 17 Apr 2019 10:09:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3HA9vn6013049 for ; Wed, 17 Apr 2019 06:09:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 394F060C67; Wed, 17 Apr 2019 10:09:57 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E34660C64 for ; Wed, 17 Apr 2019 10:09:55 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3B94859FC for ; Wed, 17 Apr 2019 10:09:53 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id h4so31164227wre.7 for ; Wed, 17 Apr 2019 03:09:53 -0700 (PDT) Received: from donizetti.redhat.com ([2001:b07:6468:f312:ac27:aac4:c65c:6eb]) by smtp.gmail.com with ESMTPSA id c13sm4949719wrx.88.2019.04.17.03.09.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Apr 2019 03:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vrd0e9JLmw/u9gAilOTX9ozl0q0+wqTOs8wpZ89MINE=; b=oldre1xrlUE5DuQOdIqMnjT/hctsoMCbERv2Do0ftLJqtUF4qVG2le9/k6l+eU1UKS +7so2itDcGg3hs5/pcu30SLiefkSHzZX0QUp03x7fEEc23ZL9Rw0GjgKAeqU+QAEgAZf LUlukde4xf1C85MS1Kd73B9gl8tdp8t0cwG5GxCucX/lNCmD/wO17/V0lKg3aqLTKDvV 8USxOVClSyXu3Fw940yy+kGgJhWho+fsPLyyskKttRIHrrhVU5vAXYLiRJA1+03LYfEI 1j/PMwO1aLIgv9tL5GzJHVyeeX6aG5+MylQQ8/SDMf1oJI4nsZuaLqnh5WPel84jM71f Zzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Vrd0e9JLmw/u9gAilOTX9ozl0q0+wqTOs8wpZ89MINE=; b=nMtLzXeWhH9S/zNrpoCfZEmnX/NkSycvtK2ASOiZvX725xi+t5zWs7T9ldarneercD KDVldeLUhrnlZCAayRHqIbF4IYmUrcaU1/ZLzcFJtlaoLXOIZMLXX5OgzkHagzUlfxKh wpzILUYjyt4flMcMJfsmAIvEo7PHq5GRIgfpPAvzsn1DYIBE2D3MEizzeMOC3EqgkKga aiN6aDXcPRuwZEai3vM6leq2xLCtv/dDsPVtYnPOGMumQQnI1gbZP3NQak9VNEzZPEJZ 4vxkRwNznvZeTQgGqzGFkWf4GM4CP0IG7hug4Db879SXAWzqcWppKmv14waWzUXhjYO3 IRxg== X-Gm-Message-State: APjAAAWxM1rJizk3D7V00hcT9rs8Zkzpi56+NkjSfSLNpbLNbMjlvlsG 5T6anBQeN7Uo9IaZL1Emo7/uW4ql X-Google-Smtp-Source: APXvYqydApoKjXi+ky9RugjP/YBpj86qfpS14kQVKfBWPqG2ISZHVCMzdy/u1HHPkn9CD732Q+ZFtA== X-Received: by 2002:a5d:4a8d:: with SMTP id o13mr43672479wrq.209.1555495791970; Wed, 17 Apr 2019 03:09:51 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 17 Apr 2019 12:09:43 +0200 Message-Id: <20190417100948.8810-3-pbonzini@redhat.com> In-Reply-To: <20190417100948.8810-1-pbonzini@redhat.com> References: <20190417100948.8810-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Apr 2019 10:09:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Apr 2019 10:09:54 +0000 (UTC) for IP:'209.85.221.50' DOMAIN:'mail-wr1-f50.google.com' HELO:'mail-wr1-f50.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.50 mail-wr1-f50.google.com 209.85.221.50 mail-wr1-f50.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/7] tags: remove reviewed property X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 17 Apr 2019 10:09:58 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Just rely on the presence/absence of the reviewers property. Signed-off-by: Paolo Bonzini --- .../0046_reviewed_message_property.py | 29 +++++++++++++++++++ mods/tags.py | 5 ++-- 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 api/migrations/0046_reviewed_message_property.py diff --git a/api/migrations/0046_reviewed_message_property.py b/api/migrati= ons/0046_reviewed_message_property.py new file mode 100644 index 0000000..f90a71b --- /dev/null +++ b/api/migrations/0046_reviewed_message_property.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations + +def delete_reviewed(apps, schema_editor): + MessageProperty =3D apps.get_model('api', 'MessageProperty') + MessageProperty.objects.filter(name=3D'reviewed').delete() + +def add_reviewed(apps, schema_editor): + Message =3D apps.get_model('api', 'Message') + MessageProperty =3D apps.get_model('api', 'MessageProperty') + props =3D MessageProperty.objects.filter(name=3D'reviewers') + for p in props: + if p.value: + new_prop =3D MessageProperty(message=3Dp.message, name=3D'revi= ewed', value=3DTrue) + new_prop.save() + +class Migration(migrations.Migration): + + dependencies =3D [ + ('api', '0045_message_maintainers'), + ] + + operations =3D [ + migrations.RunPython(delete_reviewed, + reverse_code=3Dadd_reviewed), + ] diff --git a/mods/tags.py b/mods/tags.py index 1ac27a7..e31db26 100644 --- a/mods/tags.py +++ b/mods/tags.py @@ -99,7 +99,6 @@ series cover letter, patch mail body and their replies. series_reviewers =3D _find_reviewers(series) reviewers =3D reviewers.union(series_reviewers) if num_reviewed =3D=3D series.get_num()[1] or series_reviewers: - series.set_property("reviewed", True) series.set_property("reviewers", list(reviewers)) if updated: emit_event("TagsUpdate", series=3Dseries) @@ -124,8 +123,8 @@ series cover letter, patch mail body and their replies. def prepare_message_hook(self, request, message, detailed): if not message.is_series_head: return - if message.get_property("reviewed"): - reviewers =3D message.get_property("reviewers") + reviewers =3D message.get_property("reviewers", []) + if reviewers: message.status_tags.append({ "title": "Reviewed by " + ", ".join([x for x, y in reviewe= rs]), "type": "success", --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel