Commit Graph

37 Commits

Author SHA1 Message Date
M. Zulqarnain
65f79ef9b3 BOM-2365 : pyupgrade on static_templates, staticbook and support apps (#26699)
*pyupgrade on static_templates, staticbook and support apps

This reverts commit 1ec2e797a1.

* Apply suggestions from code review

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-02-25 14:37:09 +05:00
Cory Lee
1ec2e797a1 Revert "pyupgrade on static_templates, staticbook and support apps (#26646)" (#26685)
This reverts commit a235425ac3.
2021-02-23 13:01:16 -05:00
M. Zulqarnain
a235425ac3 pyupgrade on static_templates, staticbook and support apps (#26646) 2021-02-23 12:35:53 +05:00
Feanil Patel
cd3e4353b1 feat: Add a 403 and 429 handler.
See context here: https://django-ratelimit.readthedocs.io/en/latest/cookbook/429.html#context

For now we continue to fall back to django's default 403 handler for 403
but provide a new 429 template that we use for ratelimit exceptions.

This commit also updates a logistration test that relied on the old 403
behavior of django-ratelimit instead of the newly added 429 behavior.
2021-02-08 14:03:26 -05:00
Awais Qureshi
5510dc1c43 BOM-2286
Apply pylint-amnesty.
2021-02-02 12:39:06 +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
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
zia.fazal@arbisoft.com
2453bc8c05 Stop showing hitting enterprise API in case of 404 error
Stop showing hitting enterprise API when request is originated as result of 404 error.

fixed quality violations

Removed line break

add unit tests

Updated test docstring
2020-02-14 15:16:51 +05:00
usama sadiq
720dcb6c3a Updated ExceptionViews handles
Added additional 'exception' parameter to function headers.
Disabled pylint warnings for missing docstring and unused arguments.
2020-01-10 15:56:24 +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
Stu Young
c20c770eb0 incr-297 (#20604)
* run python modernize

* run isort
2019-05-15 16:58:04 -04:00
Mike
0e2b667bb4 Added ability to change header and content of static pages in two ways.
1. Using the pageheader and pagecontent block names.
2. Setting SiteConfiguration settings for each individual html page.

Co-authored by: Tomasz Gargas <tomasz@opencraft.com>
2018-03-24 21:37:09 +01:00
Gavin Sidebottom
67442c2641 Fixed unthemed error pages in Studio and LMS 2018-02-22 16:49:06 -05:00
Jeremy Bowman
fdc50c3aa8 PLAT-1419 Make edxmako a proper template backend 2017-12-01 17:01:52 -05:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Douglas Cerna
eaa02db6ae Added Terms of Service modal 2017-05-29 11:57:04 -06:00
Calen Pennington
93970f3473 Allow edxmako to be passed an explicit request to create the RequestContext from 2016-06-08 16:35:25 -04:00
Ibrahim
0f09bb8a94 raise 404 when copyright template is missing 2016-01-22 12:02:46 -05:00
Hasnain
c14f65a293 Added site_map in static template
Allow file extensions in MKTG_URL_LINK_MAP template keys
Set content type on requests for static templates based on the template key
2016-01-14 13:44:54 -05:00
Sarina Canelake
e53b9c83d9 Use Django 1.4 @ensure_csrf_cookie method PLAT-664 2015-06-06 08:48:36 -04:00
Renzo Lucioni
f5767a961c Prep marketing iframe and relevant courseware view for email opt-in
Feature flagged. Puts a checkbox in the iframe. The iframe uses an organization_full_name parameter forwarded from Drupal by the courseware views and POSTs an email_opt_in parameter to the student views, preserving it on 403.
2014-12-01 10:30:16 -05:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
Calen Pennington
308fe26b65 Clean up pep8 E128 issues 2013-06-20 09:08:25 -04:00
Sef Kloninger
4b68e0282f press releases: use generic matching rule
This way instead of having to explicitly add releases to the urls.py
file, we just add the relase to the static_templates/press_releases
directory and the right thing happens.

Getting rid of the current "feature" where /pressrelease redirects to
the current press release.  It was broken, looks like it's unused.

Limitation: release file name must match slug, but with underscores and
all lower case.

Why bother? I wanted to do something small to learn the edX toolchain.
2013-04-10 02:16:35 -04:00
Calen Pennington
cfae1cdf62 Pep8 autofixes 2013-02-06 11:13:50 -05:00
Victor Shnayder
814cd56034 return proper error codes for 404 and 500 errors 2012-09-10 10:38:17 -04:00
Calen Pennington
1d1a9173a4 Cleaning up pep8 violations 2012-07-23 14:44:40 -04:00
Bridger Maxwell
186e5fc5e1 Cleaned up the urls file a bit, to remove urls that don't work. Also removed some unused stuff from static_template_views. 2012-07-20 15:56:48 -04:00
Bridger Maxwell
0fab4cdd93 Added a method to render 404 and 500 pages. Added a reference to these views in urls.py. 2012-07-18 14:55:12 -04:00
Bridger Maxwell
70e2f7c0d5 Merged with master. Moved a bunch of static template files to their own urls (without /t/template). 2012-07-16 15:32:22 -04:00
Bridger Maxwell
960c8619e5 Added a cache_if_anonymous decorator. 2012-07-16 13:40:17 -04:00
Bridger Maxwell
eb7ae3540c Added a simple, specific cache for the static_template_pages. 2012-07-16 09:12:50 -04:00
Bridger Maxwell
cd2eacc675 Moved static template views to one folder. Removed the stub view functions from student and used static_template_views instead. 2012-07-13 17:42:23 -04:00
Galen Frechette
35c5de8128 cleans up home page header design, adds social sharing to header, adds tos, privacy policy, honor code, help and copyright pages, add liks to those pages in footer, finished contact page 2012-07-13 13:57:02 -04:00
Galen Frechette
8a5e3bf4d2 adds pressrelease page, breaks about content into seperate pages, imporvoves some visual elements of about and jobs pages 2012-07-13 13:56:14 -04:00
Calen Pennington
5ba03130aa Moving LMS code into subdirectory 2012-06-06 14:09:01 -04:00