From d4317ae9f2b52b308302b3d7b5940e25da597f21 Mon Sep 17 00:00:00 2001 From: LEdoian Date: Mon, 17 Sep 2018 00:10:00 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20(nebyla=20definov=C3=A1na=20metoda=20hand?= =?UTF-8?q?le)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://stackoverflow.com/questions/43107630/from-django-core-management-base-import-noargscommand-commanderror-importerror --- seminar/management/commands/auth.py | 2 +- seminar/management/commands/testdata.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/seminar/management/commands/auth.py b/seminar/management/commands/auth.py index 894a87bc..71757418 100644 --- a/seminar/management/commands/auth.py +++ b/seminar/management/commands/auth.py @@ -11,7 +11,7 @@ class Command(BaseCommand): uložen v cookie sessionid) a pokud session existuje a příslušný přihlášený uživatel má právo přihlásit se do admina, vypíše jeho username. """ - def handle_noargs(self, **options): + def handle(self, *args, **options): session_key = raw_input() s = Session.objects.get(pk=session_key).get_decoded() user_id = s['_auth_user_id'] diff --git a/seminar/management/commands/testdata.py b/seminar/management/commands/testdata.py index aaa59462..9f38ab57 100644 --- a/seminar/management/commands/testdata.py +++ b/seminar/management/commands/testdata.py @@ -17,7 +17,7 @@ User = django.contrib.auth.get_user_model() class Command(BaseCommand): help = "Clear database and load testing data." - def handle_noargs(self, **options): + def handle(self, *args, **options): assert settings.DEBUG == True dbfile = settings.DATABASES['default']['NAME'] if os.path.exists(dbfile):