mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #27305 -- Removed BaseCommand.can_import_settings unused attribute
Thanks Tim Graham for the review.
This commit is contained in:
parent
bae1160c3f
commit
122c90a43b
7 changed files with 3 additions and 39 deletions
|
@ -148,7 +148,6 @@ support code::
|
|||
|
||||
class Command(BaseCommand):
|
||||
...
|
||||
can_import_settings = True
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
|
@ -208,13 +207,6 @@ Attributes
|
|||
All attributes can be set in your derived class and can be used in
|
||||
:class:`BaseCommand`’s :ref:`subclasses<ref-basecommand-subclasses>`.
|
||||
|
||||
.. attribute:: BaseCommand.can_import_settings
|
||||
|
||||
A boolean indicating whether the command needs to be able to
|
||||
import Django settings; if ``True``, ``execute()`` will verify
|
||||
that this is possible before proceeding. Default value is
|
||||
``True``.
|
||||
|
||||
.. attribute:: BaseCommand.help
|
||||
|
||||
A short description of the command, which will be printed in the
|
||||
|
@ -261,11 +253,6 @@ All attributes can be set in your derived class and can be used in
|
|||
effects. Seethe `Management commands and locales`_ section above for
|
||||
further details.
|
||||
|
||||
This option can't be ``False`` when the
|
||||
:data:`~BaseCommand.can_import_settings` option is set to ``False`` too
|
||||
because attempting to set the locale needs access to settings. This
|
||||
condition will generate a :exc:`CommandError`.
|
||||
|
||||
.. attribute:: BaseCommand.style
|
||||
|
||||
An instance attribute that helps create colored output when writing to
|
||||
|
|
|
@ -278,6 +278,8 @@ Management Commands
|
|||
* The new :option:`loaddata --exclude` option allows excluding models and apps
|
||||
while loading data from fixtures.
|
||||
|
||||
* The unused ``BaseCommand.can_import_settings`` attribute is removed.
|
||||
|
||||
Migrations
|
||||
~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ Minor features
|
|||
|
||||
* For custom management commands: Verification of the presence of valid
|
||||
settings in commands that ask for it by using the
|
||||
:attr:`~django.core.management.BaseCommand.can_import_settings` internal
|
||||
``BaseCommand.can_import_settings`` internal
|
||||
option is now performed independently from handling of the locale that
|
||||
should be active during the execution of the command. The latter can now be
|
||||
influenced by the new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue