1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #22835 -- Deprecated NoArgsCommand.

This commit is contained in:
Maxime Turcotte
2014-06-17 19:07:54 -04:00
committed by Tim Graham
parent 63670a474c
commit 9996158db4
20 changed files with 94 additions and 69 deletions

View File

@@ -603,6 +603,14 @@ class NoArgsCommand(BaseCommand):
"""
args = ''
def __init__(self):
warnings.warn(
"NoArgsCommand class is deprecated and will be removed in Django 2.0. "
"Use BaseCommand instead, which takes no arguments by default.",
RemovedInDjango20Warning
)
super(NoArgsCommand, self).__init__()
def handle(self, *args, **options):
if args:
raise CommandError("Command doesn't accept any arguments")