Změna NoArgsCommand na BaseCommand kvůli upgrade Djanga

https://docs.djangoproject.com/en/1.11/releases/1.8/

django.core.management.NoArgsCommand

The class NoArgsCommand is now deprecated and will be removed in Django
1.10. Use BaseCommand instead, which takes no arguments by default.
This commit is contained in:
LEdoian 2018-09-17 00:01:16 +02:00
parent 938974bb19
commit 6d9c2ea021
2 changed files with 4 additions and 4 deletions

View file

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.core.management.base import NoArgsCommand from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session from django.contrib.sessions.models import Session
from django.contrib.auth.models import User from django.contrib.auth.models import User
class Command(NoArgsCommand): class Command(BaseCommand):
u"""Vypiš username přihlášeného orga s daným session_key. u"""Vypiš username přihlášeného orga s daným session_key.
Příkaz pro manage.py, který ze vstupu přečte session_key (tak, jak je Příkaz pro manage.py, který ze vstupu přečte session_key (tak, jak je

View file

@ -4,7 +4,7 @@ import datetime
import os import os
import random import random
from django.core.management.base import NoArgsCommand from django.core.management.base import BaseCommand
from django.core.management import call_command from django.core.management import call_command
from django.conf import settings from django.conf import settings
@ -14,7 +14,7 @@ import django.contrib.auth
User = django.contrib.auth.get_user_model() User = django.contrib.auth.get_user_model()
class Command(NoArgsCommand): class Command(BaseCommand):
help = "Clear database and load testing data." help = "Clear database and load testing data."
def handle_noargs(self, **options): def handle_noargs(self, **options):