This hardcoded the db_alias fetched from schema_editor and forces django
to try and migrate any second database you use, rather than routing to
the default database. In testing a build from scratch, these do not
appear needed.
Using using() prevents us from using multiple databases behind edxapp.
Additionally - add back a removed backwards migration from certificates
0003. I have no idea why this was dropped in the 1.8 upgrade.
We need to be sure the migrations will work even in the presence of data
from the future. get_or_create is a problem, because if the data
already exists, there could be more than one record, even if this
migration only creates one.
Check if the request's user is authenticated before attempting to
get their user preferences. Otherwise, log warnings appear indicating
the UserNotFound error was caught.
Adds a temporary user_preference key, DARK_LANGUAGE_KEY, to hold the user's dark lang preference.
This preference key is deleted when ?clear-lang is placed in query params.
The old-style chinese language codes used in django 1.4 series are now deprecated, as discussed here: https://code.djangoproject.com/ticket/18419.
Although majority of browsers still use the old-style language codes, some new browsers such as IE11 in Windows 8.1 start to use the new-style names instead of old-style ones which makes the current chinese translations of edX can't work properly under these browsers.
As there is no easy way for edX to change a higher version of django, I think we could do some mapping here so that the users who use IE11 in Windows 8.1 or other browsers that use the new-style names can view correct translations.
Also, this fix will make users who use one of the language codes: zh-hk , zh-sg and zh-mo can see the correct translations.
To mark a language as dark-launched, add it to the DARK_LANGUAGES
django conf setting. To activate a dark-launched language, set he
query parameter `preview-lang` to the language code on any url.
[LMS-2045]
[LMS-2077]
[LMS-2076]