From patchwork Fri Aug 21 14:32:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 509509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D47CF1402A9 for ; Sat, 22 Aug 2015 00:35:04 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id A937E1A1DA0 for ; Sat, 22 Aug 2015 00:35:04 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lists.ozlabs.org (Postfix) with ESMTP id 4FC2E1A0102 for ; Sat, 22 Aug 2015 00:32:36 +1000 (AEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 21 Aug 2015 07:32:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,722,1432623600"; d="scan'208";a="629748516" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 21 Aug 2015 07:32:30 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t7LEWU3M007172; Fri, 21 Aug 2015 15:32:30 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t7LEWU1V010848; Fri, 21 Aug 2015 15:32:30 +0100 Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id t7LEWUk6010844; Fri, 21 Aug 2015 15:32:30 +0100 From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v2 12/16] management: Resolve a bug with 'retag' command Date: Fri, 21 Aug 2015 15:32:16 +0100 Message-Id: <1440167540-8751-13-git-send-email-stephen.finucane@intel.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1440167540-8751-1-git-send-email-stephen.finucane@intel.com> References: <1440167540-8751-1-git-send-email-stephen.finucane@intel.com> X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Calling 'retag' without a list of patch IDs will cause an Exception. This is due to an invalid attempt to filter patches using this empty argument. Resolve this by only filtering when we have arguments to filter with. Signed-off-by: Stephen Finucane --- patchwork/management/commands/retag.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patchwork/management/commands/retag.py b/patchwork/management/commands/retag.py index e07594a..677d1d6 100644 --- a/patchwork/management/commands/retag.py +++ b/patchwork/management/commands/retag.py @@ -12,7 +12,9 @@ class Command(BaseCommand): qs = Patch.objects if args: - qs = qs.filter(id__in = args) + qs = qs.filter(id__in=args) + else: + qs = qs.all() count = qs.count() i = 0