]> git.ozlabs.org Git - patchwork/commitdiff
management: Resolve a bug with 'retag' command
authorStephen Finucane <stephen.finucane@intel.com>
Fri, 21 Aug 2015 14:32:16 +0000 (15:32 +0100)
committerDamien Lespiau <damien.lespiau@intel.com>
Thu, 17 Sep 2015 16:57:36 +0000 (17:57 +0100)
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.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
patchwork/management/commands/retag.py

index e07594a4bb98d85095b75fb365bea6a612381b1e..677d1d6532855be629043e553d3478bf199275e3 100644 (file)
@@ -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