From nobody Tue Apr 16 16:12:53 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 header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415763940250.2603193322194; Wed, 28 Nov 2018 06:36:03 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6214331500A0; Wed, 28 Nov 2018 14:36:02 +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 43D335D6AA; Wed, 28 Nov 2018 14:36:02 +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 2DD6D3F600; Wed, 28 Nov 2018 14:36:02 +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 wASEZx5G031756 for ; Wed, 28 Nov 2018 09:35:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 70406601A8; Wed, 28 Nov 2018 14:35:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F08164438; Wed, 28 Nov 2018 14:35:59 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id 4605530842AA; Wed, 28 Nov 2018 14:35:56 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415724336396.7448574499316; Wed, 28 Nov 2018 22:35:24 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415733; cv=none; d=zoho.com.cn; s=zohoarc; b=WG+HhDmZMp9vWHbqnsGDzuA6EYJFqjNgT9dp515C67Mc8y8hgM46z9RpgWuFpxT+dcwr6EfazeC62AAtLQost3A3rlhWK+/uyxEez9/sbiImEvvG4tKAzUpWGRBgCYX4d8x3E0Aeq4W+PWeZI9rzMbLUxwarKXyef7TQwofcNR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415733; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=793r9ManS20tCUyE+R4/gKuZrsSQZZaDh6nDy8ftlvU=; b=ks2sIS8IU1vAgdXcW3t0Ykb2RSRR9Ew/0f9AUjOdmlVWhrSq58xEHjgRgJ7YhfFuV/sPsrfoUh3rN6Dya8zPxFZy//qE1FS9oMy6c1CIwGF3hjMtvvNOOV4RKDpgAAw1gNAxciKy1y5A2IrNP2zAzeEc7c+Yjf2F+3ZO+J/8v4U= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415733; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=569; bh=793r9ManS20tCUyE+R4/gKuZrsSQZZaDh6nDy8ftlvU=; b=aXtV41u2x1j1W03uTI+YsUIEAfV3NXvq0FIyo6seZScATGAOjrefTW+LeLvkqP+A Xqv/dTtSUTkcfOuDNjA6XZHZ0J/HWNQ8SY5l+wQEvPn3Q/gE/G7BKm5xONnIVG3uS6W NoOjlHA+tDxxWzr22BOaGccPwBVMLg0zCd5NpFf4= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:34:54 +0800 Message-Id: <20181128143505.27730-2-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 28 Nov 2018 14:35:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 28 Nov 2018 14:35:58 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.101 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH v2 01/12] scripts: User download.patchew.org for example DB 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: , MIME-Version: 1.0 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 28 Nov 2018 14:36:02 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- scripts/developer-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/developer-setup b/scripts/developer-setup index 9b91536..9c29a45 100755 --- a/scripts/developer-setup +++ b/scripts/developer-setup @@ -13,7 +13,7 @@ run() { =20 if ! test -f patchew-db-small.tar.xz; then echo Downloading sample database... - wget http://people.redhat.com/pbonzini/patchew-db-small.tar.xz + wget http://download.patchew.org/patchew-db-small.tar.xz fi =20 if test -d venv; then --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Tue Apr 16 16:12:53 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 header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415746929732.2490536870652; Wed, 28 Nov 2018 06:35:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 939FF30820F3; Wed, 28 Nov 2018 14:35:45 +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 848AB705A2; Wed, 28 Nov 2018 14:35:45 +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 705FA3F6E4; Wed, 28 Nov 2018 14:35:45 +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 wASEZiW9031717 for ; Wed, 28 Nov 2018 09:35:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4EB1C7A5D7; Wed, 28 Nov 2018 14:35:44 +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 3C59B611CA; Wed, 28 Nov 2018 14:35:44 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id EA362A53D0; Wed, 28 Nov 2018 14:35:39 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415732493420.69054302699465; Wed, 28 Nov 2018 22:35:32 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415736; cv=none; d=zoho.com.cn; s=zohoarc; b=Lx1Off+X8KkfPATpN5VTDjgUx8SpLG/IX9GVWB1iOQGJYrdnFutzZnjZzyK/FS6LDeOi3B1XIdpuirzO4PmqcTydd10qcdOfTduy+DGmALxAFFN0X1TnLBcszoId4/UjBfqaxKVSUtTQ0yXUavv3L928s/H79elaSShQkrOP7xo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415736; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=Lb/Ehz+9V6eyJzGjno4ALyYoeizFX3Glvj1kPLLI1ck=; b=bitafd9GzRytYWBdsNi/L5GFq92cwhS47ELe/InhS+VVmhhgt32UIt2BZWp07Qtu6PJsrhSV5Xj5RTHvqbCvJ8fsIXtoHLp/k4ND07BUVgyxmWH6KRxF2yeE4A9OcwSUr6gVfc4hv8Ym2u+UOJVOFKMdGlAe4wJKBdyv1YNsGYQ= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415736; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1201; bh=Lb/Ehz+9V6eyJzGjno4ALyYoeizFX3Glvj1kPLLI1ck=; b=OpoNsKn4uvCOTE8Y5bd1GPNlP1vg/opKUEAbDGC4LwqEBBlEIeAgiKQYl06eSKVg ty3CJ/9kpsAzlzRzpMvYAWUE7tLIRsswzjRKmwTPo5J5bogbdjrjj4uGhxajUN1oqDX 7D5DtzaF4iSQygHc7gKPzoe2bPRUN74oXlMot7KA= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:34:55 +0800 Message-Id: <20181128143505.27730-3-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 28 Nov 2018 14:35:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 28 Nov 2018 14:35:42 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.101 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: patchew-devel@redhat.com Cc: Fam Zheng Subject: [Patchew-devel] [PATCH v2 02/12] mod: Pass request in render_page_hook 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: , MIME-Version: 1.0 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 28 Nov 2018 14:35:45 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fam Zheng This will be useful soon to extract information from the request useful to generate mod content. Signed-off-by: Fam Zheng --- mods/footer.py | 2 +- www/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/footer.py b/mods/footer.py index a947253..048bbcb 100644 --- a/mods/footer.py +++ b/mods/footer.py @@ -30,6 +30,6 @@ The config is the raw HTML code to inject. name =3D "footer" default_config =3D _default_config =20 - def render_page_hook(self, context_data): + def render_page_hook(self, request, context_data): context_data.setdefault("footer", "") context_data["footer"] +=3D self.get_config_raw() diff --git a/www/views.py b/www/views.py index 2aae127..0dc146e 100644 --- a/www/views.py +++ b/www/views.py @@ -37,7 +37,7 @@ def try_get_git_head(): =20 def render_page(request, template_name, **data): data["patchew_version"] =3D settings.VERSION + try_get_git_head() - dispatch_module_hook("render_page_hook", context_data=3Ddata) + dispatch_module_hook("render_page_hook", request=3Drequest, context_da= ta=3Ddata) return render(request, template_name, context=3Ddata) =20 =20 --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Tue Apr 16 16:12:53 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 header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415753388726.5173595456037; Wed, 28 Nov 2018 06:35:53 -0800 (PST) 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 2DAE916974D; Wed, 28 Nov 2018 14:35:52 +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 1B6FD6837B; Wed, 28 Nov 2018 14:35:52 +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 0E18C3F600; Wed, 28 Nov 2018 14:35:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wASEZoZ8031739 for ; Wed, 28 Nov 2018 09:35:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id C46BB19754; Wed, 28 Nov 2018 14:35:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B64B51948E; Wed, 28 Nov 2018 14:35:50 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id 0980BA405F; Wed, 28 Nov 2018 14:35:45 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415736077924.9558547976974; Wed, 28 Nov 2018 22:35:36 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415743; cv=none; d=zoho.com.cn; s=zohoarc; b=ChrNZM7Bl7XNqNFt4qOHb3LOIuUr4kilMP1ICaZ2JaxkqGdLLBvMMHnX8WkIfRuhiwRzJYly6cnxYLjV6VJwXlhpoXqu3y7GlNp1tAax/HIGiyDreH1y3q7+wz1+pzNqczhPG0TgzGNnwPpz6fxq1ynY7s6Rpp5ftjLBVYHuGW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415743; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=yG7tUzf2Yxl5TYk25l2c26YrLoT7HC3xb6MkYvDQK2I=; b=GL8G1DG//EeRex9rw4tuD+xR+MpxlY0rvg9eVRTqQ7iUbHLzAaO6U9Q59aIRBmt+uanyf325khwFp1s4yovwl45kTiNPBYgZ0VMBlXENTAnagAS4UC0v/LT8fEQ7gDt9kmqO7TBWQ0md4aRIeOhaojF11WwNYvo/SzUpFcZg95s= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415743; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=8254; bh=yG7tUzf2Yxl5TYk25l2c26YrLoT7HC3xb6MkYvDQK2I=; b=gDHRMtJ0X4MuQWuK7Yssb0WRcW9iYbo3veGzUpSYsdS/9YKTVJA5n29e5ObTGgeN Na2iieZnFGt5S99ZeCmiMR04bQEftf7MtiMZEqjRwgdMweoZjXw8n1u/ARmevtG48hK +y+/SFmvv6PiL1aQZpP6VXmI8DIXQPummK2un0Zs= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:34:56 +0800 Message-Id: <20181128143505.27730-4-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 28 Nov 2018 14:35:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 28 Nov 2018 14:35:49 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.091 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS, T_FILL_THIS_FORM_SHORT) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Cc: Fam Zheng Subject: [Patchew-devel] [PATCH v2 03/12] Generalize Review model to Queue 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: , MIME-Version: 1.0 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.30]); Wed, 28 Nov 2018 14:35:52 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fam Zheng The concept of a queue is a per-user model for maintainers. A maintainer can have one ore more queues. The current Review model already has accept and reject stautus, so we generalize that to support a more flexible queue feature. Previously, "mark as accepted" adds a (user, message, accept=3DTrue) record in the Review model. Now it adds a (user, message, name=3D'accept') record in the Queue model. Similary, for 'mark as rejected', a (user, message, name=3D'reject') record is added in the Queue model. This makes the two queue names specially purposed on the web interface and search terms, which we'll extend to also support normal queues. Signed-off-by: Fam Zheng --- api/migrations/0042_review_to_queue.py | 19 +++++++++++ api/migrations/0043_auto_20181120_0636.py | 40 +++++++++++++++++++++++ api/models.py | 12 +++++-- api/search.py | 10 +++--- mods/maintainer.py | 23 +++++++------ 5 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 api/migrations/0042_review_to_queue.py create mode 100644 api/migrations/0043_auto_20181120_0636.py diff --git a/api/migrations/0042_review_to_queue.py b/api/migrations/0042_r= eview_to_queue.py new file mode 100644 index 0000000..3101349 --- /dev/null +++ b/api/migrations/0042_review_to_queue.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.16 on 2018-11-20 06:33 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies =3D [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('api', '0041_postgres_fts'), + ] + + operations =3D [ + migrations.RenameModel('Review', 'Queue'), + ] diff --git a/api/migrations/0043_auto_20181120_0636.py b/api/migrations/004= 3_auto_20181120_0636.py new file mode 100644 index 0000000..4f83f28 --- /dev/null +++ b/api/migrations/0043_auto_20181120_0636.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.16 on 2018-11-20 06:36 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies =3D [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('api', '0042_review_to_queue'), + ] + + operations =3D [ + migrations.RenameField( + model_name=3D'message', + old_name=3D'reviews', + new_name=3D'queues', + ), + migrations.AddField( + model_name=3D'queue', + name=3D'name', + field=3Dmodels.CharField(default=3D'accept', help_text=3D'Name= of the queue', max_length=3D1024), + preserve_default=3DFalse, + ), + migrations.RemoveField( + model_name=3D'queue', + name=3D'accept', + ), + migrations.AlterUniqueTogether( + name=3D'queue', + unique_together=3Dset([('user', 'message', 'name')]), + ), + migrations.AlterIndexTogether( + name=3D'queue', + index_together=3Dset([('user', 'message')]), + ), + ] diff --git a/api/models.py b/api/models.py index e24098b..c2cd2ac 100644 --- a/api/models.py +++ b/api/models.py @@ -436,11 +436,17 @@ def HeaderFieldModel(**args): return models.CharField(max_length=3D4096, **args) =20 =20 -class Review(models.Model): +class Queue(models.Model): user =3D models.ForeignKey(User) message =3D models.ForeignKey('Message') - accept =3D models.BooleanField() + # Special purposed queues: + # accept: When user marked series as "accepted" + # reject: When user marked series as "rejected" + name =3D models.CharField(max_length=3D1024, help_text=3D"Name of the = queue") =20 + class Meta: + unique_together =3D ('user', 'message', 'name') + index_together =3D [('user', 'message')] =20 class Message(models.Model): """ Patch email message """ @@ -479,7 +485,7 @@ class Message(models.Model): # number of patches we've got if is_series_head num_patches =3D models.IntegerField(null=3DFalse, default=3D-1, blank= =3DTrue) =20 - reviews =3D models.ManyToManyField(User, blank=3DTrue, through=3DRevie= w) + queues =3D models.ManyToManyField(User, blank=3DTrue, through=3DQueue) =20 objects =3D MessageManager() =20 diff --git a/api/search.py b/api/search.py index 659f65d..3067235 100644 --- a/api/search.py +++ b/api/search.py @@ -8,7 +8,7 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 -from .models import Message, MessageProperty, MessageResult, Result, Review +from .models import Message, MessageProperty, MessageResult, Result, Queue from functools import reduce =20 from django.db import connection @@ -265,7 +265,7 @@ Search text keyword in the email message. Example: q =3D Q(user=3Duser, **kwargs) else: q =3D Q(user__username=3Dusername, **kwargs) - return self._make_filter_subquery(Review, q) + return self._make_filter_subquery(Queue, q) =20 def _make_filter(self, term, user): if term.startswith("age:"): @@ -310,13 +310,13 @@ Search text keyword in the email message. Example: return self._make_filter_result(term[8:], status=3DResult.RUNN= ING) elif term.startswith("ack:") or term.startswith("accept:") or term= .startswith("accepted:"): username =3D term[term.find(":") + 1:] - return self._make_filter_review(username, user, accept=3DTrue) + return self._make_filter_review(username, user, name=3D"accept= ") elif term.startswith("nack:") or term.startswith("reject:") or ter= m.startswith("rejected:"): username =3D term[term.find(":") + 1:] - return self._make_filter_review(username, user, accept=3DFalse) + return self._make_filter_review(username, user, name=3D"reject= ") elif term.startswith("review:") or term.startswith("reviewed:"): username =3D term[term.find(":") + 1:] - return self._make_filter_review(username, user) + return self._make_filter_review(username, user, name=3D"accept= ") elif term.startswith("project:"): cond =3D term[term.find(":") + 1:] self._projects.add(cond) diff --git a/mods/maintainer.py b/mods/maintainer.py index a3874de..7f4f5fe 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -12,7 +12,7 @@ from django.conf.urls import url from django.http import Http404, HttpResponseRedirect from django.urls import reverse from mod import PatchewModule -from api.models import Message, Review +from api.models import Message, Queue =20 class MaintainerModule(PatchewModule): """ Project maintainer related tasks """ @@ -25,8 +25,12 @@ class MaintainerModule(PatchewModule): msg =3D Message.objects.find_series(message_id) if not msg: raise Http404("Series not found") - Review.objects.update_or_create(user=3Drequest.user, message=3Dmsg, - defaults =3D { 'accept': accept }) + if accept: + to_create, to_delete =3D 'accept', 'reject' + else: + to_create, to_delete =3D 'reject', 'accept' + Queue.objects.filter(user=3Drequest.user, message=3Dmsg, name=3Dto= _delete).delete() + Queue.objects.get_or_create(user=3Drequest.user, message=3Dmsg, na= me=3Dto_create) return HttpResponseRedirect(request.META.get('HTTP_REFERER')) =20 def _delete_review(self, request, message_id): @@ -35,7 +39,8 @@ class MaintainerModule(PatchewModule): msg =3D Message.objects.find_series(message_id) if not msg: raise Http404("Series not found") - r =3D Review.objects.filter(user=3Drequest.user, message=3Dmsg) + r =3D Queue.objects.filter(user=3Drequest.user, message=3Dmsg, + name__in=3D['accept', 'reject']) r.delete() return HttpResponseRedirect(request.META.get('HTTP_REFERER')) =20 @@ -96,11 +101,9 @@ class MaintainerModule(PatchewModule): "icon": "check", "title": "Mark series as merged"= }) =20 - try: - r =3D Review.objects.get(user=3Drequest.user, message=3Dmessag= e) - except Review.DoesNotExist: - r =3D None - if r and r.accept: + r =3D Queue.objects.filter(user=3Drequest.user, message=3Dmessage, + name__in=3D['accept', 'reject']).first() + if r and r.name =3D=3D 'accept': message.extra_status.append({ "icon": "fa-check", "html": 'The series is marked for merging' @@ -112,7 +115,7 @@ class MaintainerModule(PatchewModule): "icon": "check", "title": "Mark series as accepte= d"}) =20 - if r and not r.accept: + if r and r.name =3D=3D 'reject': message.extra_status.append({ "icon": "fa-times", "html": 'The series is marked as rejected' --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Tue Apr 16 16:12:53 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 header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415761170170.17939501334286; Wed, 28 Nov 2018 06:36:01 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D53F41F8EC; Wed, 28 Nov 2018 14:35:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C440A5C21E; Wed, 28 Nov 2018 14:35: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 B6DF0181B9E5; Wed, 28 Nov 2018 14:35:59 +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 wASEZwDr031751 for ; Wed, 28 Nov 2018 09:35:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6919170100; Wed, 28 Nov 2018 14:35:58 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A91C6EE25; Wed, 28 Nov 2018 14:35:58 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id 24BCFC0798F0; Wed, 28 Nov 2018 14:35:54 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415741981324.61033866097034; Wed, 28 Nov 2018 22:35:41 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415749; cv=none; d=zoho.com.cn; s=zohoarc; b=D7M6Nyf3AvweKrgGTsSDgfgoGLK5G4upqoWhkEXn61pqCUJZDVMSavEGDpNRsbnQC4YKqGHqomwlepNxinbk0JPf1kCDr5eGF7QagOZ3yOrqK26hNF8xWrQV0qlG56wLxFY99+o668swzoEkYzEZBcTT7bGKP82wb3wFfV/MugY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415749; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=yTX3iEjWrf4jCCsj1NcBk0UbyVAQ3/WnTRcjjFoCoeY=; b=pjkdn9JafupAC/Afd2LnR2M81xK/1ieq/HGSZsEQpxMNxaqS6GFJifsuQxq4PjF1w4OSmKcC24eOjFv7Yj4UneA0CN2AJJjVwqPKXnVK2kB7rWQuTWtRudFQzcrsFBFLGrpRB3aFK5wGAP5K7EAd0FtGlgyCXjlxuaoMZ5O/D+c= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415749; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=8524; bh=yTX3iEjWrf4jCCsj1NcBk0UbyVAQ3/WnTRcjjFoCoeY=; b=Ppk39QhmAME7KPik1d4Lx/MT/Tl7MvUmdYdiuGVtJPQxQCvbh0GWTXh0HSeBmdHz YFPFqBEkHcY5b9bo2smjFrzZ0EiZAqtPH3hsHZCGdQXLAcnJtmJmywBviwkV2aeIiwy iEZ85dWZPT6BqeYj0+hb9HLcWfNYxmy3gSf87nAk= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:34:57 +0800 Message-Id: <20181128143505.27730-5-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Nov 2018 14:35:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Nov 2018 14:35:56 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.101 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: patchew-devel@redhat.com Cc: Fam Zheng Subject: [Patchew-devel] [PATCH v2 04/12] maintainer: Queue operations in extra ops 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: , MIME-Version: 1.0 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 28 Nov 2018 14:35:59 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fam Zheng Aside 'review' and 'reject' we add operations to add and drop whole series from/to ustom queues. Initially a "add to new queue..." link is shown in the extra ops menu, which prompts for a queue name before creating and adding the current series there. Implementing the prompt takes a little enhancement to the HTML js. Once added to a queue, the series will show a new op "drop from queue '...'". A convenient op will show in the ops, "add to queue 'foo'", if the user has previously created and added some other series. This saves typing the queue name. Signed-off-by: Fam Zheng --- mods/maintainer.py | 152 +++++++++++++++++++++++-------- www/templates/series-detail.html | 30 +++++- 2 files changed, 141 insertions(+), 41 deletions(-) diff --git a/mods/maintainer.py b/mods/maintainer.py index 7f4f5fe..541d6f3 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -8,17 +8,27 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 +import re from django.conf.urls import url -from django.http import Http404, HttpResponseRedirect +from django.http import Http404, HttpResponseRedirect, HttpResponseBadRequ= est from django.urls import reverse from mod import PatchewModule -from api.models import Message, Queue +from api.models import Message, Queue, WatchedQuery =20 class MaintainerModule(PatchewModule): """ Project maintainer related tasks """ =20 name =3D "maintainer" =20 + def _add_to_queue(self, user, m, queue): + for x in [m] + list(m.get_patches()): + Queue.objects.get_or_create(user=3Duser, message=3Dx, name=3Dq= ueue) + + def _drop_from_queue(self, user, m, queue): + query =3D Queue.objects.filter(user=3Duser, message__in=3Dm.get_pa= tches() + [m], + name=3Dqueue) + q.delete() + def _update_review_state(self, request, message_id, accept): if not request.user.is_authenticated: return HttpResponseForbidden() @@ -69,6 +79,27 @@ class MaintainerModule(PatchewModule): def www_view_clear_reviewed(self, request, message_id): return self._delete_review(request, message_id) =20 + def www_view_add_to_queue(self, request, message_id): + if not request.user.is_authenticated: + raise PermissionDenied() + m =3D Message.objects.filter(message_id=3Dmessage_id).first() + if not m: + raise Http404("Series not found") + queue =3D request.GET.get("queue") + if not queue or re.match(r'[^_a-zA-Z0-9\-]', queue): + return HttpResponseBadRequest("Invalid queue name") + self._add_to_queue(request.user, m, queue) + return HttpResponseRedirect(request.META.get('HTTP_REFERER')) + + def www_view_drop_from_queue(self, request, queue, message_id): + if not request.user.is_authenticated: + raise PermissionDenied() + m =3D Message.objects.filter(message_id=3Dmessage_id).first() + if not m: + raise Http404("Series not found") + self._drop_from_queue(request.user, m, queue) + return HttpResponseRedirect(request.META.get('HTTP_REFERER')) + def www_url_hook(self, urlpatterns): urlpatterns.append(url(r"^mark-as-merged/(?P.*)/", self.www_view_mark_as_merged, @@ -85,50 +116,91 @@ class MaintainerModule(PatchewModule): urlpatterns.append(url(r"^clear-reviewed/(?P.*)/", self.www_view_clear_reviewed, name=3D"clear-reviewed")) + urlpatterns.append(url(r"^add-to-queue/(?P.*)/", + self.www_view_add_to_queue, + name=3D"add-to-queue")) + urlpatterns.append(url(r"^drop-from-queue/(?P[^/]*)/(?P.*)/", + self.www_view_drop_from_queue, + name=3D"drop-from-queue")) =20 def prepare_message_hook(self, request, message, detailed): if not detailed or not request.user.is_authenticated: return - if message.is_series_head: - if message.is_merged: - message.extra_ops.append({"url": reverse("clear-merged", - kwargs=3D{"messag= e_id": message.message_id}), - "icon": "eraser", - "title": "Clear merged state"}) + if not message.is_series_head: + return + if message.is_merged: + message.extra_ops.append({"url": reverse("clear-merged", + kwargs=3D{"message_id= ": message.message_id}), + "icon": "eraser", + "title": "Clear merged state"}) + else: + message.extra_ops.append({"url": reverse("mark-as-merged", + kwargs=3D{"message_id= ": message.message_id}), + "icon": "check", + "title": "Mark series as merged"}) + + accepted =3D False + rejected =3D False + queues =3D [] + for r in Queue.objects.filter(user=3Drequest.user, message=3Dmessa= ge): + if r.name =3D=3D 'accept': + message.extra_status.append({ + "icon": "fa-check", + "html": 'The series is marked for merging' + }) + accepted =3D True + elif r.name =3D=3D 'reject': + message.extra_status.append({ + "icon": "fa-times", + "html": 'The series is marked as rejected' + }) + rejected =3D True else: - message.extra_ops.append({"url": reverse("mark-as-merged", - kwargs=3D{"messag= e_id": message.message_id}), - "icon": "check", - "title": "Mark series as merged"= }) - - r =3D Queue.objects.filter(user=3Drequest.user, message=3Dmessage, - name__in=3D['accept', 'reject']).first() - if r and r.name =3D=3D 'accept': - message.extra_status.append({ - "icon": "fa-check", - "html": 'The series is marked for merging' - }) - else: - if message.is_series_head: - message.extra_ops.append({"url": reverse("mark-as-accepted= ", - kwargs=3D{"messag= e_id": message.message_id}), - "icon": "check", - "title": "Mark series as accepte= d"}) - - if r and r.name =3D=3D 'reject': - message.extra_status.append({ - "icon": "fa-times", - "html": 'The series is marked as rejected' - }) - else: - if message.is_series_head: - message.extra_ops.append({"url": reverse("mark-as-rejected= ", - kwargs=3D{"messag= e_id": message.message_id}), - "icon": "times", - "title": "Mark series as rejecte= d"}) - - if r: + queues.append(r.name) + message.extra_ops.append({ + "url": reverse("drop-from-queue", + kwargs=3D{ + "queue": r.name, + "message_id": message.message_id + }), + "icon": "remove", + "title": "Drop from queue '%s'" % r.nam= e}) + if not accepted: + message.extra_ops.append({"url": reverse("mark-as-accepted", + kwargs=3D{"message_id= ": message.message_id}), + "icon": "check", + "title": "Mark series as accepted"}) + if not rejected: + message.extra_ops.append({"url": reverse("mark-as-rejected", + kwargs=3D{"message_id= ": message.message_id}), + "icon": "times", + "title": "Mark series as rejected"}) + if accepted or rejected: message.extra_ops.append({"url": reverse("clear-reviewed", kwargs=3D{"message_id= ": message.message_id}), "icon": "eraser", "title": "Clear review state"}) + + if queues: + message.extra_status.append({ + "icon": "fa-bookmark", + "html": 'The series is queued in: %s' % ', '.join(queues), + }) + for q in Queue.objects.filter(user=3Drequest.user).values("name").= distinct(): + qn =3D q["name"] + if qn in queues + ['reject', 'accept']: + continue + message.extra_ops.append({ + "url": "%s?queue=3D%s" % (\ + reverse("add-to-queue", + kwargs=3D{"message_id": message.message_id= }), + qn), + "icon": "bookmark", + "title": "Add to '%s' queue" % qn}) + + message.extra_ops.append({ + "url": reverse("add-to-queue", + kwargs=3D{"message_id": message.message_id}), + "get_prompt": {"queue": "What is the name of the new queue?" }, + "icon": "bookmark", + "title": "Add to new queue..."}) diff --git a/www/templates/series-detail.html b/www/templates/series-detail= .html index c7b7f1d..dcf7b79 100644 --- a/www/templates/series-detail.html +++ b/www/templates/series-detail.html @@ -40,11 +40,39 @@
    {% for op in series.extra_ops %}
  • + {% if op.get_prompt %} + {% for k, v in op.get_prompt.items %} + + {% endfor %} + {% endif %} {{ op.title }}
  • + {% if op.get_prompt %} + href=3D"#" + onclick=3D"prompt_and_open(this, '{{ op.url }}')" + {% else %} + href=3D"{{ op.url }}" + {% endif %}">{{ op.title }} {% endfor %}
+ {% endif %} =20
--=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Tue Apr 16 16:12:53 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 header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415766174844.0862855776232; Wed, 28 Nov 2018 06:36:06 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 001483091D52; Wed, 28 Nov 2018 14:36:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E11FD7A5E6; Wed, 28 Nov 2018 14:36:04 +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 D38D1181B9E5; Wed, 28 Nov 2018 14:36:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wASEa3M2031772 for ; Wed, 28 Nov 2018 09:36:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2A25419493; Wed, 28 Nov 2018 14:36:03 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1764C1948E; Wed, 28 Nov 2018 14:36:03 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id DF81B30BCBFE; Wed, 28 Nov 2018 14:35:56 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415748846631.5689003729335; Wed, 28 Nov 2018 22:35:48 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415754; cv=none; d=zoho.com.cn; s=zohoarc; b=DsjG8dEPnX/g8Qs1oqXiJMfPmEIazrxUBcgF8yuCJYHiDBYQVqGZtW+PGgVX+XRr7xTgiKX7GZSvlaL4booUB1vkwFSpX+ms3/5QiWnH3M0m4ybE3xwJb051WM71+NPTox6SYttQ0LwXlVjh6XWxbZ3dnCnYlMQ6C9BF6phAhfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415754; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=RY/J0nTL95h1WEXt4WSeCasZevo9wDzfaBXn9MgZgtw=; b=eXJxd9sYBknCBDiLSOH2d5aaPTsxORY2+MqHyB9I7qqDAf+hv7BXpwXkdN31yMQLGWJ5UTK7JICAKeredzeZGj6o7dOYG3Zgp7AOjQ5Yd7wNKdwzA+Bjnh6D9hNSHolg1K84LvTDpiobvX9UGpT5UYHp++5N4HFNFeZWOVR9YKc= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415754; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=2307; bh=RY/J0nTL95h1WEXt4WSeCasZevo9wDzfaBXn9MgZgtw=; b=dusNk9z3ouVKRMk16sjit8JBBfqHm0775EbrTPhcN+uSN27l4pPG4PyDmNfZUmcM YILh4Wy9qXAhRCRNFu6nkESYrMNZItYfgPeEszselC8pmRGnUa7uF/XIAkqxJ2VYqzu QEuE5hv4mG76mDqVUR++YoPMxfgtjK/6YkatFxOY= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:34:58 +0800 Message-Id: <20181128143505.27730-6-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 28 Nov 2018 14:36:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 28 Nov 2018 14:36:01 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.101 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Cc: Fam Zheng Subject: [Patchew-devel] [PATCH v2 05/12] model: Introduce WatchedQuery 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: , MIME-Version: 1.0 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 28 Nov 2018 14:36:05 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fam Zheng Every user can have a record in WatchedQuery. The query in this record is going to be run against every new series, and if matched, the patches will be added to the 'watched' queue, making this the 3rd specially purposed queue. Signed-off-by: Fam Zheng --- api/migrations/0044_watchedquery.py | 26 ++++++++++++++++++++++++++ api/models.py | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 api/migrations/0044_watchedquery.py diff --git a/api/migrations/0044_watchedquery.py b/api/migrations/0044_watc= hedquery.py new file mode 100644 index 0000000..6568c13 --- /dev/null +++ b/api/migrations/0044_watchedquery.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.16 on 2018-11-28 13:25 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies =3D [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('api', '0043_auto_20181120_0636'), + ] + + operations =3D [ + migrations.CreateModel( + name=3D'WatchedQuery', + fields=3D[ + ('id', models.AutoField(auto_created=3DTrue, primary_key= =3DTrue, serialize=3DFalse, verbose_name=3D'ID')), + ('query', models.TextField(help_text=3D'Watched query')), + ('user', models.ForeignKey(on_delete=3Ddjango.db.models.de= letion.CASCADE, related_name=3D'watched_queries', to=3Dsettings.AUTH_USER_M= ODEL)), + ], + ), + ] diff --git a/api/models.py b/api/models.py index c2cd2ac..e56f059 100644 --- a/api/models.py +++ b/api/models.py @@ -442,6 +442,7 @@ class Queue(models.Model): # Special purposed queues: # accept: When user marked series as "accepted" # reject: When user marked series as "rejected" + # watched: When a series matches user's watched query name =3D models.CharField(max_length=3D1024, help_text=3D"Name of the = queue") =20 class Meta: @@ -767,3 +768,8 @@ class Module(models.Model): =20 def __str__(self): return self.name + +class WatchedQuery(models.Model): + """ User watched query """ + user =3D models.ForeignKey(User, on_delete=3Dmodels.CASCADE, related_n= ame=3D'watched_queries') + query =3D models.TextField(blank=3DFalse, help_text=3D"Watched query") --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Tue Apr 16 16:12:53 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 header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415783662784.5990144575687; Wed, 28 Nov 2018 06:36:23 -0800 (PST) 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 6BACD83F63; Wed, 28 Nov 2018 14:36:22 +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 566686837B; Wed, 28 Nov 2018 14:36:22 +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 46E6641FB9; Wed, 28 Nov 2018 14:36:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wASEaL4S032008 for ; Wed, 28 Nov 2018 09:36:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7386C5C21E; Wed, 28 Nov 2018 14:36:21 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 512AE7C278; Wed, 28 Nov 2018 14:36:17 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id 24CCC3086252; Wed, 28 Nov 2018 14:35:59 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415753165603.9947265359569; Wed, 28 Nov 2018 22:35:53 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415757; cv=none; d=zoho.com.cn; s=zohoarc; b=evEsBE3Q6f4n4bLZZRZrTjJgBDO/w0E5uT6/tGyo1iPMG73LmegHa+4aVH0tAIaa90ofqg3YGayfa+kX62Wwcv/533T78HNiVbfBSvEvCPajHWI31CDhRvGExcoFOc5KuN4eoOcVWiVdcgaobIiz51AFm6l1zwxaF5AqGcwL7zE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415757; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=E3iB7p+E5XZW8o53NEnlQ/WAgx/BvwHEMXo3wpiJmp8=; b=fQAr9Jjt9g2L+HkF9ACbBd+AADQ1qDCOdgqU/5cwJlXUkfMG8I1sTb0D39AsT/ex3mGnGFmw6wDQmKe8Ee8vHhD4h58yacwHIMwU43Dd4Ul1MT6g2VCszXlJX9OWEtqNB2ctyB8zH6+bSKp2XsNDLQB+v92l2EJutP591dXgScs= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415757; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=2340; bh=E3iB7p+E5XZW8o53NEnlQ/WAgx/BvwHEMXo3wpiJmp8=; b=Wp1c4A8B4ZL1KY5eif4aD8xecQFyEV0hm+KwLi7IoHe5bAehekUk/zQu/BCin8lz ImaAIKx7IHJ9fi6nHzwRxenrovmt/4UDUXry+kCC8EQcUjTScvpj0s+mmvaMr+xIfMT kSp7HnQALVLusd3V9ttMF+GStMM9v1L23so5TAJ0= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:34:59 +0800 Message-Id: <20181128143505.27730-7-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 28 Nov 2018 14:36:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 28 Nov 2018 14:36:16 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.101 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: patchew-devel@redhat.com Cc: Fam Zheng Subject: [Patchew-devel] [PATCH v2 06/12] Add "Watch query" button to search result page 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: , MIME-Version: 1.0 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.29]); Wed, 28 Nov 2018 14:36:22 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fam Zheng This button will update the search query used to automatically populate the user's 'watched' queue. Signed-off-by: Fam Zheng --- mods/maintainer.py | 17 +++++++++++++++++ www/templates/series-list.html | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/mods/maintainer.py b/mods/maintainer.py index 541d6f3..54738ec 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -100,6 +100,22 @@ class MaintainerModule(PatchewModule): self._drop_from_queue(request.user, m, queue) return HttpResponseRedirect(request.META.get('HTTP_REFERER')) =20 + def render_page_hook(self, request, context_data): + if request.user.is_authenticated and context_data.get("is_search"): + q =3D WatchedQuery.objects.filter(user=3Drequest.user).first() + if q and q.query =3D=3D context_data.get("search"): + context_data["is_watched_query"] =3D True + + def www_view_watch_query(self, request): + if not request.user.is_authenticated: + raise PermissionDenied() + query =3D request.GET.get("q") + if not query: + return HttpResponseBadRequest("Invalid query") + WatchedQuery.objects.update_or_create(defaults=3D{"query": query}, + user=3Drequest.user) + return HttpResponseRedirect(request.META.get('HTTP_REFERER')) + def www_url_hook(self, urlpatterns): urlpatterns.append(url(r"^mark-as-merged/(?P.*)/", self.www_view_mark_as_merged, @@ -122,6 +138,7 @@ class MaintainerModule(PatchewModule): urlpatterns.append(url(r"^drop-from-queue/(?P[^/]*)/(?P.*)/", self.www_view_drop_from_queue, name=3D"drop-from-queue")) + urlpatterns.append(url(r"^watch-query/", self.www_view_watch_query= )) =20 def prepare_message_hook(self, request, message, detailed): if not detailed or not request.user.is_authenticated: diff --git a/www/templates/series-list.html b/www/templates/series-list.html index 8a29f98..6c77d47 100644 --- a/www/templates/series-list.html +++ b/www/templates/series-list.html @@ -74,6 +74,14 @@
{% endif %} =20 +{% if is_search %} + {% if is_watched_query %} +

Saved as my watched query

+ {% else %} + + {% endif %} +{% endif %} +