From nobody Sat Dec 21 14:53:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1645810998; cv=none; d=zohomail.com; s=zohoarc; b=S+rnMsYKU9fNKkN9byD4WBlkhC836DtIfxpJEPLAI2CkKOtv1ZJpNe4Q19ion4K2cOgE2bBSBPUtDcXYz2mBZQEavnzs7chVrLWV6NPCYeZM3HHwEXagg7CA3f6No7fQCbkZ/2CamlGvyvA+RWVcTuY03LkvoqgGgLWj++npqUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645810998; 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; bh=n8Zy070ib7dgFnjixBk7kZj1w7AV2pSHSjpiJYLj/fg=; b=hs02z/hL7dDFtx2ve6vRVhdwZAd0tPqByjuVNRZ2BJOTxZJAMC/Xtk329dixSYtvQ7HM6VnkwGADy/Zt8vxILjaaLbo97X+oto2V7Qo/iBQldMOXMqyU3qEAzYDMF+Wxu3JsEqVDlTw5xLMjuukmN5uGgAc12NwMaShg4UQUswM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645810998852670.9248468033599; Fri, 25 Feb 2022 09:43:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-417-LHwwYxE3O4G7IHy8C36FOw-1; Fri, 25 Feb 2022 12:43:16 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A35971854E2E; Fri, 25 Feb 2022 17:43:15 +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 9AD572B4AF; Fri, 25 Feb 2022 17:43:15 +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 4D0B34BB40; Fri, 25 Feb 2022 17:43:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PHhDGj002322 for ; Fri, 25 Feb 2022 12:43:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id D3B2A87540; Fri, 25 Feb 2022 17:43:13 +0000 (UTC) Received: from avogadro.lan (unknown [10.39.193.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A39C8C75C for ; Fri, 25 Feb 2022 17:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645810997; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=n8Zy070ib7dgFnjixBk7kZj1w7AV2pSHSjpiJYLj/fg=; b=UKkn2/6Vwb2oW7JAk3fE4UfnS1A5pIoGzNHJt1DZhwEvD0LdvzbWcfbcllDOvZokWa71Zc CvDFloZAR5Mc4EdSAXoUoncWXxudSDU0QLR4/xY5CiSonTt/wV7cXh4J/swFMuCgHzss3h A/jR+FMnhZb/buTQKA/byiwQUP1dKlM= X-MC-Unique: LHwwYxE3O4G7IHy8C36FOw-1 From: Paolo Bonzini To: patchew-devel@redhat.com Date: Fri, 25 Feb 2022 18:43:05 +0100 Message-Id: <20220225174305.612960-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] git: expose push options in the series/unapplied endpoint 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: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645810999801100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- mods/git.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/git.py b/mods/git.py index b1c4e14..50a1b39 100644 --- a/mods/git.py +++ b/mods/git.py @@ -358,10 +358,17 @@ class ApplierGetView(APILoginRequiredView): class UnappliedSeriesSerializer(SeriesSerializer): class Meta: model =3D Message - fields =3D SeriesSerializer.Meta.fields + ("mirror", "result_uri") + fields =3D SeriesSerializer.Meta.fields + ("mirror", "result_uri",= "push_options") =20 mirror =3D SerializerMethodField() result_uri =3D SerializerMethodField() + push_options =3D SerializerMethodField() + + def get_push_options(self, obj): + if obj.project.config.get("git", {}).get("use_git_push_option", Fa= lse): + return obj.git_result.data.get("git.push_options") + else: + return None =20 def get_result_uri(self, obj): request =3D self.context["request"] --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel