Commit Graph

38 Commits

Author SHA1 Message Date
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
c21ac0c3df replaced unittest assertions pytest assertions (#26573) 2021-02-22 20:04:27 +05:00
usamasadiq
297dfd9718 Applied pylint amnesty 2021-02-04 19:14:40 +05:00
Jawayria
1e0655d26b Resolved pep8 errors 2021-02-02 21:15:43 +05:00
Jawayria
9909b933a7 Applied pylint-amnesty to openedx/core/{djangolib, lib, tests, *.py 2021-02-02 21:13:24 +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
Leonardo Martinez
b4fee68283 Fix the DeprecationWarning for unescape (#23936)
This PR solves the DeprecationWarning mentioned in:
https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/warning_5freport_5fall_2ehtml/

HTMLParser was renamed in html.parser in Python3:
https://docs.python.org/2/library/htmlparser.html#module-HTMLParser

* html_parser.HTMLParser().unescape from six.moves has been deprecated

* instead use html.unescape from Python3

Documentation for unescape in Python3:
https://docs.python.org/3/library/html.html#html.unescape

- html_parser from six.moves has been deprecated

- instead use html.parser from Python3

- Order imports using isort

- Delete unused import crum
2020-06-19 09:27:45 -04:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
Manjinder Singh
d08cd9ce04 Removing provider imports from edx-platform (#23229)
* Removing from provider imports from openedx

 * removed all uses of retire_dop_oauth2_models

* Removing provider library from lms, common, and cms

Created/copied function short_token(from django-oauth-provider) and create_hash256 to help with conversion
2020-03-02 08:56:54 -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
jinder1s
93dcd26118 quality fixes 2019-10-09 09:30:52 -04:00
jinder1s
d8b7a2e1fe quality fixes 2019-10-09 08:53:22 -04:00
jinder1s
075faede22 Modifying test to work in both py2 and 3 2019-10-09 08:53:22 -04:00
aarif
13afdbb84c python 3 fixes
minor changes
2019-09-27 15:59:03 +05:00
Braden MacDonald
d3f6ed09d8 Learning Contexts, New XBlock Runtime, Blockstore API Client + Content Libraries
https://github.com/edx/edx-platform/pull/20645

This introduces:
* A new XBlock runtime that can read and write XBlocks that are persisted using
  Blockstore instead of Modulestore. The new runtime is currently isolated so
  that it can be tested without risk to the current courseware/runtime.
* Content Libraries v2, which store XBlocks in Blockstore not modulestore
* An API Client for Blockstore
* "Learning Context" plugin API. A learning context is a more abstract concept
  than a course; it's a collection of XBlocks that serves some learning purpose.
2019-08-30 10:31:15 -07:00
Hammad Ahmad Waqas
63d7b7d6fa applying filter to remove dangerous html content before rendering in
course_about page on course overview field
2019-06-21 16:06:26 +05:00
aliciaerwin
140fb1394e INCR-166 Run python-modernize on openedx/core/djangolib (#20473)
* INCR-166 Run python-modernize on openedx/core/djangolib

* INCR-166 disabled harmless errors and added docstring
2019-05-09 13:59:48 -04:00
Jeremy Bowman
5c7a8e3ac1 Merge pull request #19622 from cclauss/Fix-parens-for-Python3
Fix explicit tuple parameters for Python 3
2019-02-21 15:45:09 -05:00
Calen Pennington
78c8950ea3 Clean up a few remaining unicode format string errors 2019-02-20 15:28:14 -05:00
cclauss
44d62fac75 Fix explicit tuple parameters for Python 3 2019-02-19 12:37:34 +01:00
Matthew Piatetsky
444799fb0e fix unicode strings in openedx/ part 2 2019-02-15 10:15:51 -05:00
Michael Youngstrom
4bbd1dee0b Remove shards from commonlib-unit tests 2019-02-12 14:28:35 -05:00
Jeremy Bowman
3ff3eee2f2 TE-2689 Remove useless pylint suppressions part 4 2018-08-20 12:54:22 -04:00
Jeremy Bowman
c290bf8a07 TE-2524 Stop using nose.plugins - openedx 2018-08-02 14:54:50 -04:00
sandroroux
0094443b19 Creates oauth2_retirement_utils file, used it to retire oauth2 data. 2018-05-02 15:55:51 -04:00
Awais Jibran
74341b7dd5 Convert date to lower if language is spainish. 2018-03-12 15:57:25 +05:00
Adeel Khan
b497210f17 strip_all_tags_but_br_filter would return HTML safe string.
Now returning HTML safe string to template instead
of just bleaching string for br tags.

LEARNER-3930
2018-01-23 17:15:33 +05:00
Adeel Khan
5773001f75 Fix certificate's course title for xss tags injection.
This fix would enable course author to selectively add
basic html tags to course title, while removing any
other injected tags that could execute javascript.

LEARNER-3491
2017-12-18 14:08:22 +05:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Calen Pennington
bc20a37c2b Simplify how shards are selected in CI 2016-08-03 16:23:02 -04:00
Robert Raposa
7223ee9316 Fix import order for HTML, Text. 2016-05-23 08:47:08 -04:00
Robert Raposa
a6ac06f210 Remove outdated safe template recommendations
- Remove <%include> linting
- Remove dump_html_escaped_json
2016-04-06 14:57:48 -04:00
Ben Patterson
c504029b39 Create a third shard for lms unit tests.
This will leverage the nose attrib plugin to allow us
to break tests apart on our build system to run
in parallel on separate nodes.
2016-03-17 12:01:42 -04:00
Robert Raposa
8e1e4a4715 Use markup HTML helper with Text
TNL-4160
2016-03-04 10:44:41 -05:00
Robert Raposa
29fe2c7b0c Move markup helpers to djangolib 2016-02-05 02:42:43 -05:00
Robert Raposa
f555ffd585 Refactor and improve js_utils helpers
- Rename escape_json_dumps to dump_js_escaped_json
- Rename escape_js_string to js_escaped_string
- Update js_escaped_string to output empty string for None
- Introduce dump_html_escaped_json
- Move dump_js_escaped_json after the pipe as new best practice
- Introduce additional uses of helpers
- Introduce new djangolib directory and move js_utils
2016-02-03 17:13:21 -05:00