Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix imports style and made feed_name optional

Krzysztof Wolski15914cc8bd29
diff --git a/saleor/integrations/management/commands/update_integrations.py b/saleor/integrations/management/commands/update_integrations.py
index 414c9f8e3e..d4173a5809 100644
--- a/saleor/integrations/management/commands/update_integrations.py
+++ b/saleor/integrations/management/commands/update_integrations.py
@@ -2,19 +2,20 @@ from __future__ import unicode_literals
from django.core.management import CommandError, BaseCommand
-from saleor.integrations.feeds import SaleorFeed
-from saleor.integrations import utils
+from ....integrations.feeds import SaleorFeed
+from ....integrations import utils
class Command(BaseCommand):
- help = 'Updates integration feeds. '
+ help = ('Updates integration feeds.'
+ 'If feed name not provided, updates all available feeds')
feed_classes = {'saleor': SaleorFeed}
def add_arguments(self, parser):
- parser.add_argument('feed_name', nargs='+', type=str)
+ parser.add_argument('feed_name', nargs='*', type=str, default=None)
def handle(self, *args, **options):
- feed_names = options['feed_name'] or self.feed_classes.keys()
+ feed_names = options.get('feed_name') or self.feed_classes.keys()
for feed_name in feed_names:
feed = self.feed_classes.get(feed_name)
if feed is None: