From: Stephen Finucane Date: Fri, 21 Aug 2015 14:32:16 +0000 (+0100) Subject: management: Resolve a bug with 'retag' command X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=ac63b6b3564186191928044528e2afda862b7bc0;p=patchwork 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 --- 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