From 172a55e7b69ef218ca0ef34115c4c1375cdc1ae0 Mon Sep 17 00:00:00 2001 From: Derek Stegelman Date: Sat, 18 Mar 2017 16:00:39 -0600 Subject: [PATCH] Remoe optional arguments. --- mailqueue/management/commands/clear_sent_messages.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mailqueue/management/commands/clear_sent_messages.py b/mailqueue/management/commands/clear_sent_messages.py index 53750c5..523dfb9 100644 --- a/mailqueue/management/commands/clear_sent_messages.py +++ b/mailqueue/management/commands/clear_sent_messages.py @@ -8,14 +8,7 @@ class Command(BaseCommand): def add_arguments(self, parser): # Positional arguments - parser.add_argument('offset', type=int) - - # Named (optional) arguments - parser.add_argument('--offset', - action='store_true', - dest='offset', - default=False, - help='Only clear messages that are more than this many hours old') + parser.add_argument('offset', nargs="?", type=int) def handle(self, *args, **options): MailerMessage.objects.clear_sent_messages(offset=options['offset'])