`settings.FORMAT_MODULE_PATH` contains module, in which this string is
defined.
So, when you create object of this model via admin interface, the
following things happen:
1. Django calls `construct_change_message` to create LogEntry, which is
decorated with `@translation_override(None)`, which will deactivate
current language
2. To write object representation with custom format in change message,
`django.utils.formats.get_format` will be called
3. `get_format` will try to find custom format, but it can't be done when
active language is None, so original string will be returned as-is
4. `django.utils.dateformat.format` will interpret custom format string
literally, which may not fail with exception, but will be totally wrong
anyway
--
Ticket URL: <https://code.djangoproject.com/ticket/27296>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* component: Uncategorized => contrib.admin
* needs_tests: => 0
* needs_docs: => 0
Comment:
Do you have any suggestions about how to fix that?
--
Ticket URL: <https://code.djangoproject.com/ticket/27296#comment:1>
Comment (by Ivan Tsouvarev):
Hard to say. May be there is a way to avoid translation without
deactivating current language?
--
Ticket URL: <https://code.djangoproject.com/ticket/27296#comment:2>
Comment (by Claude Paroz):
I don't see a proper solution yet, apart from providing some default
yourself by comparing the `get_format` return value.
--
Ticket URL: <https://code.djangoproject.com/ticket/27296#comment:3>
* status: new => closed
* type: Uncategorized => New feature
* resolution: => needsinfo
Comment:
Feel free to reopen if someone thinks of a proposal of how Django could
facilitate this use case.
--
Ticket URL: <https://code.djangoproject.com/ticket/27296#comment:4>