Activated language not respected in post_save signal called during custom management command
|Reported by:||Mike||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||1.6|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This one is a little tricky to explain. My problem seems to be this:
- run custom management command
- activate language from settings, which is "en-gb"
- dynamically import module for a Django app and invoke custom bootstrap function
- calling get_language() in bootstrap function returns "en-gb"
- bootstrap function calls loaddata management command (using management.call_command)
- data created in DB, which triggers a post_save signal
- get_language() in post_save signal always returns "en-us"
I don't know if the signal is invoked in a separate thread but I would expect get_language to return the newly activated language when called in a post_save signal. Or am I missing something? Thanks