Commit Graph

43 Commits

Author SHA1 Message Date
M. Zulqarnain
41e5403f4e BOM-2369 (D): pyupgrade on contentstore/views (#26767)
* pyupgrade on contentstore/views

* Apply suggestions from code review

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-03-05 14:55:14 +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
Kyle McCormick
a3deb6e317 Sort imports in cms/
Command: `isort --recursive cms/`
2020-10-19 09:34:31 -04:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04: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
aarif
b20eb309ff ran python-modernize and isort on files mentioned in INCR-332
changes made to comply with pylint

refactored the code to comply with PEP8

further changes made to comply with quality

changes made as suggested
2019-07-22 10:02:59 +00:00
Mike Dikan
2c149ca6be Removing the Deprecated the 'external_auth' package in favor of 'third_party_auth' which is the current recommendation. 2019-03-02 16:06:46 -05:00
Nimisha Asthagiri
886bc4b20b Studio login/registration redirects to LMS 2018-12-17 20:50:57 -05: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
Michael Roytman
3496bb9a0a pass language to mako template 2018-02-12 15:44:20 -05:00
Michael Roytman
eeb6cc7ca3 Add accessibility accomodation request page to studio and link to said page in footer, both behind a Waffle switch. Add tests for the new page. 2017-12-01 19:57:21 -05:00
John Eskew
0890193d6b PLAT-1408: Import csrf from new path. 2017-10-05 11:12:53 -04:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
Nimisha Asthagiri
fd49f88e08 Moves external_auth from common to openedx/core. 2016-10-07 12:34:22 -04:00
Saleem Latif
8ae92901ef 1. Merge microsites into Comprehensive Theming
2. Add site configuration overrides to theming/helpers.py
3. Move microsite.get_value from theming/helpers to site_configuration/helpers
4. Move microsite_configuration.microsite.get_value usages to site_configuration.helpers.values
2016-07-27 13:55:14 +05:00
Diana Huang
0248f8af6d Add new clickjacking decorator that whitelists LTI consumers. 2015-10-07 11:20:51 -04:00
Sarina Canelake
e53b9c83d9 Use Django 1.4 @ensure_csrf_cookie method PLAT-664 2015-06-06 08:48:36 -04:00
Jonathan Piacenti
eabd6c8d27 Quality check and test fixes. 2015-01-12 13:41:03 +03:00
Calen Pennington
85ca7db7a6 Fix merge conflicts relative to master 2014-05-12 11:42:21 -04:00
Calen Pennington
19acdd31e8 Merge remote-tracking branch 'edx/master' into opaque-keys-merge-master
Conflicts:
	cms/djangoapps/contentstore/views/public.py
	common/djangoapps/external_auth/tests/test_ssl.py
	common/djangoapps/student/views.py
	lms/djangoapps/dashboard/sysadmin.py
	lms/templates/notes.html
2014-05-12 11:35:03 -04:00
Carson Gee
cbf525f6cf Fix infinite redirect loop on logout caused by django caching 2014-05-09 14:22:11 -04:00
Carson Gee
5452de20d8 Modified ssl certificate authentication to handle next redirection
Makes small changes in lms and cms both so that user's go to the
original page they intended to if they weren't already logged in
2014-05-09 14:22:10 -04:00
Calen Pennington
0d88379eeb Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit adds all of cms.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-07 12:56:43 -04:00
Carson Gee
4099fc9af0 Correct misaligned django-cas integration 2014-03-04 09:35:08 -05:00
Chris Dodge
aa43689a93 This PR addresses the open feedback on the Microsites feature 2014-02-28 16:27:12 -05:00
Carson Gee
8cbe263ca0 Rename of feature AUTH_USE_MIT_CERTIFICATES to AUTH_USE_CERTIFICATES across platform.
Caution! This is backwards incompatible
2014-02-04 10:50:48 -05:00
Carson Gee
f33c308979 Switched from symlink to rename of template 2014-02-03 14:12:30 -05:00
Carson Gee
2bf6df23c8 More fully integrate and test ssl external auth in CMS 2014-02-03 14:00:40 -05:00
Chris Dodge
a3211a7405 Introduction of the Microsite feature which allows for limited multi-tenant branding on a subdomain basis, e.g. foo.edx.org and bar.edx.org
fix errorenous logic when running a microsite that could reside in a hosting environment with a marketing site in front of it

pep8/pylint fixes

address PR feedback, remove underscore from test hostname

more pep8/pylint cleanup. Skip test_microsites test, it works on localdev, not on Jenkins. Need to talk with QA team

manually add Ned's single-to-double quote fix

change aws.py runtimes so that the microsite_dir that is read from configuration is changed to a python path

Conflicts:
	lms/templates/help_modal.html
2014-01-14 14:36:01 -05:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
cahrens
d1c19cb563 Minor cleanup around public RESTful URLs.
STUD-849
2013-11-20 14:20:59 -05:00
Brian Talbot
8048a4b25b Studio: changes URL for password reset to direct to LMS login view
STUD-689
2013-11-01 16:37:08 -04:00
Don Mitchell
f41816637e RESTful refactoring of /course access continued
Move index access into the url
Move course creation into the url
Add helper methods for testing to serialize json data and set accept header.
2013-10-30 13:28:22 -04:00
David Baumgold
248793c127 Fix some pylint issues 2013-07-31 15:42:11 -04:00
David Baumgold
8e384a73be Remove proof-of-concept page 2013-05-22 15:55:51 -04:00
Steve Strassmann
8bb6ad3689 relative imports 2013-05-13 11:31:56 -04:00
Steve Strassmann
979e3be174 fix pep8: imports and blank lines 2013-05-13 09:58:30 -04:00
Steve Strassmann
571a9af0c0 declared exports 2013-05-10 16:37:28 -04:00
Steve Strassmann
01d4fbeb7c reorder imports 2013-05-10 14:14:36 -04:00
Steve Strassmann
9350a2c067 refactoring views 2013-05-10 13:56:30 -04:00
Steve Strassmann
0bea50ede1 start refactoring views.py 2013-05-09 16:24:21 -04:00