From ac63b6b3564186191928044528e2afda862b7bc0 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 21 Aug 2015 15:32:16 +0100 Subject: [PATCH] management: Resolve a bug with 'retag' command 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 Signed-off-by: Stephen Finucane Signed-off-by: Damien Lespiau --- 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.39.2