1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Fixed ping_google management command to use argparse.

This commit is contained in:
R3v1L 2014-09-01 11:38:08 +01:00 committed by Loic Bistuer
parent a8521a2c22
commit 03c1a6cb80

View File

@ -5,9 +5,8 @@ from django.contrib.sitemaps import ping_google
class Command(BaseCommand):
help = "Ping Google with an updated sitemap, pass optional url of sitemap"
def add_arguments(self, parser):
parser.add_argument('sitemap_url', nargs='?', default=None)
def execute(self, *args, **options):
if len(args) == 1:
sitemap_url = args[0]
else:
sitemap_url = None
ping_google(sitemap_url=sitemap_url)
ping_google(sitemap_url=options['sitemap_url'])