From nobody Fri Apr 19 19:13:08 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; 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=1555433280; cv=none; d=zoho.com; s=zohoarc; b=XwvQH7kdg+FGT0gocmU1JHY+ufc6fHRk2hpWZ3YI/Kck/l1kZe2bbFqqKIN8ICdQs6L0y+AESb+AoaIFMxhEEUstxpJTl4DY/2iBO+I3Y9osCnSiY+//nNz9KjZu3zN7fK8zYBcGNmvm4LLiU3OQ+M3cITrQb8UxHrt4hEB+N2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555433280; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=AKFYD+181PPo7iPsFP3a1BMZBlvqYqElSanOhN7+BEg=; b=CiWzaA6CQqLVnYALnZFVs5+LXtdS0v1pWHuXjhvIMf4tS7nU5PdjdHtNCKKUJHKbNbvPUO1nDJni3THLQjBAlFWycVPP4TnwY8Gygj1fWi9fQR1Q3YmlC75ZUlffclN5gOFdxijnkzLf52wbDCu0wfZ5g92dtrSR+tmQ95iI0zo= ARC-Authentication-Results: i=1; mx.zoho.com; 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 1555433280575205.98749271597103; Tue, 16 Apr 2019 09:48:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 297493082201; Tue, 16 Apr 2019 16:47:59 +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 1F4D15D9D4; Tue, 16 Apr 2019 16:47:59 +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 159EC4EE03; Tue, 16 Apr 2019 16:47:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3GGlviD022174 for ; Tue, 16 Apr 2019 12:47:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B36760141; Tue, 16 Apr 2019 16:47:57 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-49.ams2.redhat.com [10.36.112.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFF6B604A2 for ; Tue, 16 Apr 2019 16:47:54 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Tue, 16 Apr 2019 18:47:53 +0200 Message-Id: <20190416164753.27632-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] models: add SeriesMerged event 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 16 Apr 2019 16:47:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This can be used to send email when a patch is applied. Reviewed-by: Fam Zheng --- api/models.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/api/models.py b/api/models.py index aa99eb8..f3e8211 100644 --- a/api/models.py +++ b/api/models.py @@ -278,8 +278,7 @@ class Project(models.Model): if not p.is_merged: break else: - series.is_merged =3D True - series.save() + series.set_merged() return len(updated_series) =20 def create_result(self, **kwargs): @@ -306,7 +305,8 @@ class ProjectProperty(models.Model): =20 declare_event("SeriesComplete", project=3D"project object", series=3D"series instance that is marked complete") - +declare_event("SeriesMerged", project=3D"project object", + series=3D"series instance that is marked complete") =20 declare_event("MessageAdded", message=3D"message object that is added") =20 @@ -740,6 +740,13 @@ class Message(models.Model): self.save() emit_event("SeriesComplete", project=3Dself.project, series=3Dself) =20 + def set_merged(self): + if self.is_merged: + return + self.is_merged =3D True + self.save() + emit_event("SeriesMerged", project=3Dself.project, series=3Dself) + def create_result(self, **kwargs): return MessageResult(message=3Dself, **kwargs) =20 --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel