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 <[email protected]>
---
 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
-- 
2.0.0

_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to