From 315d5a68b88042da023e67452c0c50ebfdaf155c Mon Sep 17 00:00:00 2001 From: Derek Stegelman Date: Tue, 14 Mar 2017 20:14:56 -0600 Subject: [PATCH] Management command fix for issue #92 --- docs/source/commands.rst | 2 +- docs/source/conf.py | 4 ++-- mailqueue/__init__.py | 2 +- mailqueue/management/commands/send_queued_messages.py | 9 +-------- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/source/commands.rst b/docs/source/commands.rst index 21ad6b3..8a1f8c7 100644 --- a/docs/source/commands.rst +++ b/docs/source/commands.rst @@ -8,7 +8,7 @@ You can use this management command to send email if you do not setup a cron job or use celery. You can specify a limit on the amount of emails you want to attempt to send at one time.:: - python manage.py send_queued_messages --limit=20 + python manage.py send_queued_messages 20 Clear Sent messages diff --git a/docs/source/conf.py b/docs/source/conf.py index 1eefc0f..61dabae 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = '3.0.0' +version = '3.0.1' # The full version, including alpha/beta/rc tags. -release = '3.0.0' +release = '3.0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/mailqueue/__init__.py b/mailqueue/__init__.py index cb20a2b..3bae8ed 100644 --- a/mailqueue/__init__.py +++ b/mailqueue/__init__.py @@ -1,3 +1,3 @@ -VERSION = '3.0.0' +VERSION = '3.0.1' default_app_config = 'mailqueue.apps.MailQueueConfig' diff --git a/mailqueue/management/commands/send_queued_messages.py b/mailqueue/management/commands/send_queued_messages.py index 4269cd2..ce2176c 100644 --- a/mailqueue/management/commands/send_queued_messages.py +++ b/mailqueue/management/commands/send_queued_messages.py @@ -8,14 +8,7 @@ class Command(BaseCommand): def add_arguments(self, parser): # Positional arguments - parser.add_argument('limit', nargs='+', type=int) - - # Named (optional) arguments - parser.add_argument('--limit', - action='store_true', - dest='limit', - default=False, - help='Limit the number of emails to process') + parser.add_argument('limit', nargs='?', type=int) def handle(self, *args, **options): MailerMessage.objects.send_queued(limit=options['limit'])