Commit Graph

25 Commits

Author SHA1 Message Date
Kevin Falcone
2d9708da03 Remove uses of using() from migrations
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.
2016-02-01 16:57:26 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Ned Batchelder
e7fcc743c0 More-correct data migrations
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.
2015-11-11 09:03:21 -05:00
Ned Batchelder
680271d466 Correct the darklang migration, since many darklang configs can exist. 2015-11-10 21:04:25 -05:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
Sarina Canelake
28a234380a Dark lang middleware: Check if user is authenticated
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.
2015-06-30 20:01:00 -04:00
Sarina Canelake
e485e5ee24 Dark language should stay set until explicitly cleared.
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.
2015-06-26 13:41:14 -04:00
Sarina Canelake
91a7df8832 Replace deprecated 'django_language' key with LANGUAGE_SESSION_KEY
LOC-87
2015-06-26 13:15:43 -04:00
Sarina Canelake
34b2c91709 dark_lang: only allow released langs in accept header LOC-72, LOC-85
Only return languages we've actually released LOC-85
Perform fuzzy matching to greedily serve the best released language LOC-72
2015-06-26 13:15:42 -04:00
Sarina Canelake
def22d2cfc Store released dark_lang codes as all lower-case 2015-06-26 13:15:41 -04:00
Sarina Canelake
33e43bcf54 Port django.utils.translation.trans_real.parse_accept_lang_header from Django 1.8
Add to dark_lang middleware
2015-06-26 13:15:41 -04:00
Sarina Canelake
780ec6ee2c Allow released languages to be previewed under dark lang 2015-06-06 09:49:06 -04:00
Ned Batchelder
78e9445aa1 Add super() calls to setUp/tearDown that are missing them
Also, I replaced a number of tearDown methods with addCleanup instead.
And also remove some unneeded patch.stopall() calls.
2015-05-14 18:14:21 -04:00
Sarina Canelake
0dad9da5e4 s/pylint: disable=W0621/pylint: disable=redefined-outer-name/ 2014-12-01 11:22:08 -05:00
stv
fb9f324f2f Fix PEP8: E303 too many blank lines 2014-11-10 11:00:14 -08:00
louyihua
6d7839007a Do not merge zh-hk into zh-tw in darklang 2014-06-12 01:19:49 +08:00
Sarina Canelake
41b25fec9a Ensure system language is released in dark lang middleware
LMS-2644
2014-05-05 15:42:48 -04:00
louyihua
80e1270587 Make new-style chinese language codes works for translation
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.
2014-04-02 13:12:44 +08:00
Julia Hansbrough
08939b64dc Fixed confusing docstring 2014-03-13 22:09:29 +00:00
Sarina Canelake
cdfb5c0c07 Put language modal in alphabetical order LMS-2302 2014-03-10 11:07:13 -04:00
Julia Hansbrough
cb6b52f890 wiring for language selector 2014-02-14 10:32:10 -05:00
Calen Pennington
d00314c8bc Handle mixed case language codes coming from the browser or in dark-lang configuration 2014-02-03 11:32:49 -05:00
Calen Pennington
994dde910b Add failing test for different capitalizations of language codes coming from the browser 2014-02-03 11:32:49 -05:00
Calen Pennington
271fbdb40a Switch dark_lang to database backed configuration 2014-01-29 13:24:41 -05:00
Calen Pennington
881e3ba564 Add the ability to dark-launch languages
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]
2014-01-29 09:16:16 -05:00