Commit Graph

25 Commits

Author SHA1 Message Date
Awais Qureshi
094573e901 BOM-2375-student-part2
pyupgrade in student app.
2021-03-10 16:17:22 +05:00
Aarif
802ae6343b replaced unittest assertions pytest assertions (#26527) 2021-02-18 18:08:52 +05:00
Jawayria
8086ca75f2 Applied pylint-amnesty to student 2021-02-03 15:29:53 +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
Giovanni Cimolin da Silva
8a143a4298 Add site configuration flag to allow changing redirection after login 2020-07-16 09:17:17 -03:00
Kyle McCormick
234eedd8c6 Handle next and course_id in /login_ajax
Currently, the /login_ajax endpoint does not regard
any `next` or `course_id` parameters. This commit changes
that, sharing the logic that /login (which the current
templated login page uses) employs to cacluate
a redirect-after-login URL based on `next` and `course_id`.

The new functionality is behind ENABLE_LOGIN_MICROFRONTEND.
2020-02-13 12:24:51 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -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
Robert Raposa
2202545aec remove studio signin and signup pages
This completes the work started in https://github.com/edx/edx-platform/pull/19453
to use the LMS login and registration for Studio, rather than Studio
providing its own implementation.

LMS login/registration are being used for the following reasons:
1. LMS logistration properly handles all SSO integrations.
2. A single logistration is simpler to maintain and understand.
3. Allows Studio to work more like all other IDAs that use LMS
logistration.

The original switch to use LMS logistration for Studio also added the
toggle `DISABLE_STUDIO_SSO_OVER_LMS` to provide the community some
additional time for switching. This commit removes this toggle, which
at this point means all deployments will use the LMS logistration.

This change requires sharing cookies across LMS and Studio. Should that
prove to be a problem for certain Open edX instances, there are
discussions of possible alternative solutions.
See https://github.com/edx/edx-platform/pull/19845#issuecomment-559154256

Detailed changes:
* Fix some Studio links that still went to old Studio signin and signup.
* Remove DISABLE_STUDIO_SSO_OVER_LMS feature toggle.
* Remove old studio signin and signup pages and templates.
* Fix url name "login", which had different meanings for Studio and LMS.
* Use the following settings: LOGIN_URL, FRONTEND_LOGIN_URL,
FRONTEND_LOGOUT_URL, and FRONTEND_REGISTER_URL.
* Redirect /signin and /signup to the LMS logistration.
* Add custom metric `uses_pattern_library`.
* Add custom metric `student_activate_account`.
* Add Django Settings to allow /signin, /signup, and /login_post to be
disabled once ready.

This work also relates to ARCH-218 and DEPR-6.

ARCH-1253
2019-12-04 02:36:36 -05:00
Jeremy Bowman
f68c7e87f7 Fix student.helpers logging tests 2019-09-18 12:59:32 -04:00
Cameron Cairns
6363090144 Addresses INCR-195 - runs modernise /student/tests (#20419) 2019-05-07 15:44:49 -04:00
Robert Raposa
863f86c411 Move and rename redirect helper.
- Rename is_safe_redirect to is_safe_login_or_logout_redirect.
- Moved is_safe_login_or_logout_redirect to user_authn.

ARCH-256
2018-10-12 13:33:09 -04:00
Robert Raposa
027c53e61e Add ability to redirect to subdomain for logout.
ARCH-241
2018-10-03 12:13:14 -04:00
Robert Raposa
23b9cfd76c Add whitelist for login redirect.
Use LOGIN_REDIRECT_WHITELIST to provide a whitelist of
additional domains to which login will now redirect.

ARCH-238
2018-10-02 16:00:55 -04:00
Michael Youngstrom
d6616c9036 Add require_https to all is_safe_url calls 2018-06-07 10:10:28 -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
asadiqbal
30db538e3a Change the log level to info 2018-05-31 19:43:11 +05:00
Saleem Latif
f087672d4b On edx.org instances, next URL for login page cannot contain 'edx.org'. 2017-08-25 17:31:35 +05:00
Jillian Vogel
84c6c5ac27 Adds THIRD_PARTY_AUTH_HINT to SiteConfiguration and to site-wide setting.FEATURES
When provided, this setting appends tpa_hint=<value> to the `next` URL provided for /login and /register page URLs, which bypasses the Open edX Login/Register page with an an automatic redirection to the TPA login/register URL.

This allows the already implemented tpa_hint feature to be automatically added to login, registration, and enrolment URLs generated throughout the platform.

Avoids auto-appending the tpa_hint parameter when the request is already in the TPA pipeline, to prevent infinite redirect loops, and adds tests to verify this behaviour.
2017-08-17 14:01:00 +09:30
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Ahsan Ulhaq
7712bf3151 edx.org/login?next= should not be able to point to an asset
ECOM-6463
2017-03-07 22:17:50 +05:00
Simon Chen
c38de9638c Revert "edx.org/login?next= should not be able to point to an asset"
This reverts commit bc418c47c5.
2017-02-17 14:53:57 -05:00
Ahsan Ulhaq
bc418c47c5 edx.org/login?next= should not be able to point to an asset
ECOM-6463
2017-02-16 14:44:01 +05:00
Ahsan Ulhaq
7368c3428f use reverse 2016-10-25 23:28:09 +05:00
Ahsan Ulhaq
c49f84fa3c parameter next on login page would redirect regardless url safe
ECOM-5968
2016-10-25 15:08:40 +05:00