Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#19730 closed New feature (fixed)

Action triggered by django.core.management.base.BaseCommand.can_import_settings is a side effect of i18n locale handling

Reported by: Ramiro Morales Owned by: nobody
Component: Core (Management commands) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As discussed in #17379

(from https://code.djangoproject.com/ticket/17379#comment:7):

can_import_settings was supposed to check if settings are available before execution of a command according to documentation (​https://docs.djangoproject.com/en/dev/howto/custom-management-commands/#BaseCommand.can_import_settings). It was doing that only by coincidence… it was doing that by forcing en_us locale via translation module which relies on settings.

This ticket will act as a dependancy of #17379.

Change History (3)

comment:1 by Claude Paroz, 11 years ago

Resolution: fixed
Status: newclosed
Type: UncategorizedNew feature

Fixed in [869c9ba30615cb24fb5786787a2db8655f2f0d2b]:

Fixed #19730 -- Don't validate importability of settings by using i18n in management commands.

They are handled independently now and the latter can be influenced by
the new BaseCommand.leave_locale_alone internal option.

Thanks chrischambers for the report, Claude, lpiatek, neaf and gabooo for
their work on a patch, originally on refs. #17379.

comment:2 by Claude Paroz, 11 years ago

Thanks Ramiro for taking this forward. However I'm not sure about the comment: because many of them create database content that is locale-sensitive (like permissions).

So apart from syncdb, which are the commands who alter the database with potentially localized content?

in reply to:  2 comment:3 by Ramiro Morales, 11 years ago

Replying to claudep:

Thanks Ramiro for taking this forward. However I'm not sure about the comment: because many of them create database content that is locale-sensitive (like permissions).

So apart from syncdb, which are the commands who alter the database with potentially localized content?

I will reword that paragraph beacuse I can only think of 'test'. Thanks!

Note: See TracTickets for help on using tickets.
Back to Top