diff mbox

[v2,12/16] management: Resolve a bug with 'retag' command

Message ID 1440167540-8751-13-git-send-email-stephen.finucane@intel.com
State Accepted
Headers show

Commit Message

Stephen Finucane Aug. 21, 2015, 2:32 p.m. UTC
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 <stephen.finucane@intel.com>
---
 patchwork/management/commands/retag.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

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