Commit Graph

56 Commits

Author SHA1 Message Date
Jawayria
8fc7333982 Refactor: Remove unused imports
Removed unused imports from openedx/core/djangoapps/{dark_lang, django_comment_common, embargo, lang_pref, oauth_dispatch, plugins, programs, schedules}
2021-04-06 17:11:59 +05:00
M. Zulqarnain
c8902bed58 refactor: pyupgrade in heartbeat, lang_pref, models (#26916) 2021-03-16 14:15:01 +05:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.

We should not be applying lint amnesty for such a violation.
2021-03-05 08:11:58 -05:00
Aarif
cfcb9330b3 replaced unittest assertions pytest assertions (#26568) 2021-02-22 12:24:33 +05:00
M. Zulqarnain
99c169c444 pylint amnesty in heartbeat,header_control and lang_pref (#26369) 2021-02-04 15:32:10 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Zachary Trabookis
7b3525278e Fix SameSite cookie issue for LTI Provider. EW-449
There was an issue where external LMS system (e.g. Canvas, Blackboard) that used Open edX LTI Provider calls had cookies blocked. This update fixes this issue by defining third-party cookies to have attributes of `Secure=True` and `SameSite=None`.

Details here: https://discuss.openedx.org/t/lti-xblock-and-samesite/759/5

(cherry picked from commit 28479a2966b87b16a25dbc96c19b6f5817d255de)
2020-04-13 17:14:15 +09:30
Aarif
97d327feeb BOM-1121
Old style mixin compatibility with django2.2
2020-01-30 16:36:02 +05:00
Waheed Ahmed
49abac5812 Remove lang cookie for mobile app requests. (#22731)
* Remove lang cookie for mobile app requests.

Responses for mobile app requests must not include language preference cookie.

PROD-1107
2020-01-07 15:49:36 +05:00
Waheed Ahmed
78dabaf2b5 Fix update session language endpoint.
PROD-1107
2020-01-06 18:57:46 +05:00
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
Bill DeRusha
c76390729d REVERT PR #22152 88e7589a19 2019-10-31 13:06:24 -04:00
uzairr
4efe22c959 Disable language preference cookie to mobile views.
Language preference cookie is not allowing to change the site
language on mobile-apps affecting user-experience.To improve it,
mobile team suggested to disable the language preference cookie
for the request originated from mobile.

PROD-782
2019-10-30 17:12:10 +05:00
Nimisha Asthagiri
f533134db1 Merge pull request #22086 from edx/arch/user-authn-delete-deprecated
User Authn: Remove deprecated, ENABLE_COMBINED_LOGIN_REGISTRATION
2019-10-29 09:37:53 -04:00
Nimisha Asthagiri
db42c7e1e2 User Authn: Remove deprecated, ENABLE_COMBINED_LOGIN_REGISTRATION 2019-10-29 08:57:58 -04:00
adeelehsan
88e7589a19 Logs added to investigate the middleware 2019-10-25 15:27:26 +05:00
Ayub
85be57b64a Merge pull request #21397 from edx/BOM-95
BOM-95
2019-08-22 12:41:08 +05:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Feanil Patel
73a146fbbe Revert "assertItemsEqual() moved to assertCountEqual()"
This reverts commit 3d2617983b.

The change was not quite right because the method six provides needs to
have `self` be passed in as well.  See the docs here:
https://six.readthedocs.io/#unittest-assertions

Reverting for now and we can fix it in smaller chunks later.
2019-08-20 15:31:20 -04:00
Dave St.Germain
3d2617983b assertItemsEqual() moved to assertCountEqual() 2019-08-19 17:00:17 -04:00
Dave St.Germain
9d8db8e4ca Convert to utf-8 before JSON decoding 2019-08-19 15:10:56 -04:00
Constanza Abarca
bf0c109b66 INCR-191 2019-04-25 13:51:23 -04:00
Waheed Ahmed
d76a2463fa Add support for beta languages.
Whenever user selects a beta language on account settings page,
show a page level warning message that this language is not
fully translated along with action to revert.

LEARNER-5654
2019-02-06 15:18:04 +05:00
Ned Batchelder
3353e7425e Remove unused imports 2018-11-03 16:07:05 -04:00
Michael Youngstrom
3da94170f5 Switch auth backends for cms as well 2018-10-15 11:14:25 -04:00
Stuart Young
0dd13fad1b add paver timeout decorator and npm installation logs 2018-09-07 08:46:04 -04:00
Michael Youngstrom
bc1d883e1a Dont let DarkLangConfig cache interfere with other tests 2018-09-06 10:33:54 -04:00
Jeremy Bowman
d90afa4cde TE-2689 Remove useless pylint suppressions part 5 2018-08-21 11:07:52 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Eric Fischer
e18448e27d Silence deprecation warnings
https://docs.djangoproject.com/en/1.11/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods
2018-05-02 10:03:50 -04:00
Nimisha Asthagiri
38cfadeb20 Schedules: convert course language to supported released language 2017-11-29 20:08:33 -05:00
Ned Batchelder
e23e3a0486 Fix a number of unused-import pylint violations 2017-11-21 19:57:06 -05:00
John Eskew
7b4a3c1714 Move email_marketing startup.py to AppConfig::ready().
Remove query counting of LMS signals.
2017-11-03 13:57:38 -04:00
Awais Jibran
125552f204 Switching course view to specific student retains the profile language setting
https://openedx.atlassian.net/browse/EDUCATOR-891
2017-07-19 16:48:18 +05:00
Anthony Mangano
4f4f25b432 Set ui_lang in Sailthru when creating and updating users 2017-07-11 11:27:01 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Anthony Mangano
0172ff315a add ability to show footer language selector on LMS 2017-05-24 16:41:45 -04:00
Calen Pennington
c9f6872be3 Capture the language preference set by an anonymous user when the register or login
[LEARNER-168]
2017-05-15 07:36:56 -04:00
Calen Pennington
74ce1ae918 Update comment to reflect the code in lang_pref tests 2017-05-03 11:09:18 -04:00
Calen Pennington
4b512626f8 Reset the SESSION language when the language-preference cookie changes 2017-05-02 11:24:41 -04:00
Calen Pennington
1811f7235f Minimize the number of queries done while noop updating a user-preference 2017-04-28 12:26:41 -04:00
Calen Pennington
33fee20c3a Reapply "Merge pull request #14868 from cpennington/learner-542"
This reverts commit 65f13ddec4.
2017-04-27 09:25:02 -04:00
Calen Pennington
65f13ddec4 Revert "Merge pull request #14868 from cpennington/learner-542"
This reverts commit 88dd85caec, reversing
changes made to bf8aef33fc.
2017-04-26 11:29:56 -04:00
Calen Pennington
dffcb13c0e Validate that the language cookie is preserved during logout 2017-04-25 11:46:52 -04:00
Calen Pennington
f8b050a5d8 Put LANGUAGE_COOKIE into settings 2017-04-24 13:03:17 -04:00
Calen Pennington
e733179d49 Store Learner language preferences into a cookie rather than the session
This modifies the lang-pref django app to:
a) Use the current value of the 'edx-language-preference' cookie to set the
   users Accept-Language header on an incoming request.
b) At the end of the request, update the 'edx-language-preference' cookie
   to reflect the users current Language Preference choice, if any.

[LEARNER-542]
2017-04-24 07:37:19 -04:00