From nobody Thu Apr 25 00:31:40 2024 Delivered-To: importer2@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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547721701220341.34545187870947; Thu, 17 Jan 2019 02:41:41 -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 E069B7BDA5; Thu, 17 Jan 2019 10:41:39 +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 CC57A5C687; Thu, 17 Jan 2019 10:41:39 +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 BA58D3F7CD; Thu, 17 Jan 2019 10:41:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0HAfd7R002499 for ; Thu, 17 Jan 2019 05:41:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1EAFD5DD6D; Thu, 17 Jan 2019 10:41:39 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CE2718669 for ; Thu, 17 Jan 2019 10:41:35 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 17 Jan 2019 11:41:34 +0100 Message-Id: <20190117104134.15772-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH fixed] search: fix "review", add "watch" 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 17 Jan 2019 10:41:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" --- api/search.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/search.py b/api/search.py index e9cf7ec..baf6893 100644 --- a/api/search.py +++ b/api/search.py @@ -162,6 +162,7 @@ Syntax: - accept:USERNAME or ack:USERNAME - the series was marked as accepted by = the user - reject:USERNAME or nack:USERNAME - the series was marked as reject by t= he user - review:USERNAME - the series was marked as accepted or rejected by the = user + - watch:USERNAME - the series is in the user's watched queue =20 USERNAME can be "me" to identify the current user =20 @@ -267,7 +268,7 @@ Search text keyword in the email message. Example: return Q(is_merged=3DTrue) return None =20 - def _make_filter_review(self, username, user, **kwargs): + def _make_filter_queue(self, username, user, **kwargs): if username =3D=3D "me": if not user.is_authenticated: # Django hack to return an always false Q object @@ -320,13 +321,16 @@ 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, name=3D"accept= ") + return self._make_filter_queue(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, name=3D"reject= ") + return self._make_filter_queue(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, name=3D"accept= ") + return self._make_filter_queue(username, user, name__in=3D["ac= cept", "reject"]) + elif term.startswith("watch:") or term.startswith("watched:"): + username =3D term[term.find(":") + 1:] + return self._make_filter_queue(username, user, name=3D"watched= ") elif term.startswith("project:"): cond =3D term[term.find(":") + 1:] self._projects.add(cond) --=20 2.20.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel