Commit Graph

116 Commits

Author SHA1 Message Date
Awais Qureshi
1ab5d4dfed Merge pull request #26671 from edx/BOM-2374-edxmako
Run Pyupgrade on edxmako.
2021-03-09 18:35:14 +05:00
Awais Qureshi
f1f1933ab4 BOM-2374
Run Pyupgrade on edxmako.
2021-03-05 18:17:41 +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
Jawayria
ebc6044c10 BOM-2028: Removed unused imports from common/djangoapps/{course_modes, edxmako, entitlements} 2021-02-23 19:30:09 +05:00
Aarif
7dfd6edd23 replaced unittest assertions pytest assertions (#26524) 2021-02-18 18:08:23 +05:00
usamasadiq
de99865eb6 Fix pep8 errors 2021-02-02 17:59:20 +05:00
usamasadiq
515458b9dc Applied pylint-amnesty 2021-02-02 17:59:20 +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
Ned Batchelder
21d7e6f3b2 Use https for open.edx.org 2020-11-02 11:29:03 -05:00
Tim McCormack
f29e418264 Revert "Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)" (#25055)
This reverts commit 986a448d9e.
2020-09-28 13:53:57 +00:00
Ahtisham Shahid
986a448d9e Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)
This reverts commit ba9ee4e151.

Fixed Style lint issue
2020-09-21 13:48:00 +05:00
Tim McCormack
ba9ee4e151 ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)
This uses the new names introduced in edx-django-utils
3.8.0 (edx/edx-django-utils#59), which we're already using, as
well as updating a few other locations where we incorrectly refer
to New Relic custom metrics instead of custom attributes.

Includes a couple of unrelated lint fixes in a file I modified.
2020-09-18 13:33:50 +00:00
Feanil Patel
4ac2c5e92b Correct logic on building marketing links.
The logic used to has a special case for edge in the hostname which
didn't really make sense. So instead we just check to see if the given
url starts with http and if it does we return it directly.  If it doesn't,
then we try to convert it to a valid url and return that.  If that fails
we return .

Add a new custom metric `unresolved_marketing_link` to track when we
run into this scenario.
2020-07-09 15:09:38 -04:00
Feanil Patel
b6fdad2ea4 If this reverse failed, it was throwing a 500.
Catch the 500 in this case and throw a 404 instead.
2020-07-08 15:56:53 -04:00
Jeremy Bowman
5c40a3729a Stop using deprecated assertions (#23579)
Replace some usage of deprecated assertions with non-deprecated equivalents.
2020-04-02 11:06:37 -04:00
Aarif
765942d7d2 Updated the template loaders to make them compatible with django 1.11,2.0 and above 2020-03-28 13:27:38 +05:00
David Ormsbee
45c97c789d Merge pull request #20378 from open-craft/giovanni/bb-986-add-mktg-override-capability-upstream
BB-986: Add variable that allows overriding marketing urls
2020-02-26 09:45:35 -05:00
David Ormsbee
5ce6cecfed Re-enable caching of context processor output
In Django template rendering, context processors only run once.
But when we do template rendering through edxmako (which we do for
each and every web fragment/XBlock), we can end up having hundreds
of invocations of templates and run context processors for each
separately. This removes that work.

This was originally added in ad5cc3d5 and reverted when we saw
errors in one of our environments that seemed to be related to
context processor code. Those errors persisted after the revert,
and so I'm adding this back in (with some modifications based on
review comments).
2020-02-25 17:48:45 -05:00
Giovanni Cimolin da Silva
6305fbdfb6 Add mktg links override capability
This commit adds a feature that allows overriding any marketing URL, either by configuration on lms.env.json or SiteConfiguration, regardless if a marketing website is set up.
The links can be set by passing MKTG_URL_OVERRIDES to either `lms.env.json` or `SiteConfiguration`.
2020-02-25 13:51:58 -03:00
mraarif
ecdf2a3ebd updated the custom Loader to remove deprecated methods 2020-01-10 03:16:29 +05:00
David Ormsbee
bb271e10e8 Revert "Request cache context processor output."
This reverts commit ad5cc3d5d9.

This was causing middleware errors while processing 404s.
2020-01-09 10:51:42 -05:00
David Ormsbee
ad5cc3d5d9 Request cache context processor output.
In Django template rendering, context processors only run once.
But when we do template rendering through edxmako (which we do for
each and every web fragment/XBlock), we can end up having hundreds
of invocations of templates and run context processors for each
separately. This removes that work.
2019-12-30 16:38: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
uzairr
c545ed8bbe Update privacy and TOS links for edge.
Currently,edge environment is serving empty pages against privacy
and TOS.Now, this behaviour is modified by pointing those links to
edX's privacy and TOS pages.

PROD-1066
2019-12-13 17:39:03 +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
553d35e53e Upgrade mock BOM-596 (#21717) 2019-09-24 10:14:17 -04:00
Diana Huang
bf7dad15e4 Remove microsite djangoapp except migrations and configuration. 2019-08-16 09:42:57 -04:00
Ayub
560da82837 Merge pull request #21067 from edx/INCR-402
INCR-402 python3 compatibility
2019-07-22 14:47:18 +05:00
Feanil Patel
d1556fc86d md5 needs bytes in python 3 but a sting is fine in python2. 2019-07-19 09:48:10 -04:00
Ayub khan
6661745e77 INCR-402 python3 compatibility 2019-07-11 14:42:14 +05:00
Jeremy Bowman
237d264a50 DEPR-12 Remove microsites references from edxmako (#20796) 2019-06-11 15:27:10 -04:00
Chris Pappas
d937708432 Merge pull request #20438 from edx/cpappas/ENT-1887
ENT-1887 | Adding logic for new business marketing footer url constru…
2019-05-10 16:28:27 -04:00
Christopher Pappas
4c5ca6d086 ENT-1887 | Adding logic for new business marketing footer url construction, while maintaining backwards compatibility
Fixing quality test

Testsing out a default value for the sake of jenkins tests. will revert

Fix footer test from being flaky

Moving an import statement

ran isort. adding a test. fixing 1 quality issue

Quality cleanups

Attempting more quality fixes

adding back in config variable name for default value

Adding ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS to common settings

Changing marketing_url logic to only concatenate enterprise url to root if the enterprise url is relative (starts with a /)

quality fixes
2019-05-09 17:15:47 -04:00
Amit
328bcbe047 INCR-135: Run python-modernize on common/djangoapps/edxmako (#20483) 2019-05-09 10:08:57 -04:00
Nimisha Asthagiri
700a902b68 Cleanup and remove deprecated RequestCache Django app
ARCH-223
2018-09-12 14:39:11 -04:00
Robert Raposa
ba4cc62ff8 Retire deprecated RequestCache (Take 2)
ARCH-223
2018-09-08 15:09:28 -04:00
Nimisha Asthagiri
4ca165f690 Revert "ARCH-223: Retire deprecated RequestCache." 2018-08-30 16:33:03 -04:00
Robert Raposa
3df339a56a Retire deprecated RequestCache.
ARCH-223
2018-08-30 08:55:19 -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
Qubad786
64555c60c0 Move request_cache to openedx.core.djangoapps 2018-01-26 15:09:25 +05:00
Chandrakant Gopalan
f6f29ca49e Allow theme template block overrides.
This allows an overridding template from a theme to inherit from the
same corresponding standard template.

This is useful when you only want to override one or more named blocks,
but otherwise make no modifications to the standard template.
2017-12-22 09:41:35 +01:00
Jeremy Bowman
103c723c6d PLAT-1801 Preserve new user login behavior under Django 1.10+ 2017-12-05 10:20:25 -05:00
Eric Fischer
2e3f871c12 Memoize common lookups during request
Prevents repeated memcached lookups on functions whose values should
remain static for the lifetime of a request.

EDUCATOR-1731
2017-12-04 11:54:50 -05:00
Jeremy Bowman
067785dbfd Merge pull request #16710 from edx/jmbowman/PLAT-1419
PLAT-1419 Make edxmako a proper template backend
2017-12-04 11:07:30 -05:00
Jeremy Bowman
fdc50c3aa8 PLAT-1419 Make edxmako a proper template backend 2017-12-01 17:01:52 -05:00
Jesse Zoldak
9c49c10b27 Revert "Allow theme template block override" 2017-11-30 17:09:13 -05:00