You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in order to configure fieldsets the CONSTANCE_CONFIG_FIELDSETS setting must be set to a dictionary that maps the header name as the key to the fieldset options as the value. Example from the docs:
This causes an issue when attempting to use gettext_lazy for the header names. This is because the header name is the key for the dictionary, so Python will attempt to hash the value for the key. The Django proxy objects will in turn attempt to cast itself to a string in order to compute the hash. (as seen here)
This causes an issue, because the translation is attempted immediately, however the apps are not yet loaded as Django is still processing the settings file, so it will raise this error:
django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
Describe the problem
Currently in order to configure fieldsets the
CONSTANCE_CONFIG_FIELDSETS
setting must be set to a dictionary that maps the header name as the key to the fieldset options as the value. Example from the docs:This causes an issue when attempting to use
gettext_lazy
for the header names. This is because the header name is the key for the dictionary, so Python will attempt to hash the value for the key. The Django proxy objects will in turn attempt to cast itself to a string in order to compute the hash. (as seen here)This causes an issue, because the translation is attempted immediately, however the apps are not yet loaded as Django is still processing the settings file, so it will raise this error:
Steps to reproduce
System configuration
Notes
As far as I can tell, there is no workaround possible, so header names cannot be translated.
The text was updated successfully, but these errors were encountered: