Commit Graph

145 Commits

Author SHA1 Message Date
stvn
5dd8302d8b refactor: Move GlobalStaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
Jawayria
953f1fa05c Merge pull request #26615 from edx/jawayria/bom-2408-7
BOM-2408: Removed unused imports from openedx/core/{djangolib, lib} a…
2021-04-12 14:45:52 +05:00
Usama Sadiq
6a79d47589 refactor: Ran pyupgrade on openedx/{testing, tests} 2021-04-08 14:49:40 +05:00
Jawayria
4cdf466215 refactor: Removed unused imports
Removed unused imports from openedx/core/{djangolib, lib} and openedx/{tests, features}
2021-04-06 17:24:04 +05:00
Kyle McCormick
bcb48525ac refactor: clean up unused ERROR_ON_DEPRECATED_EDX_PLATFORM_IMPORTS (#26900)
The setting overrides should've been cleaned up in a previous
commit, but I missed them. This change is a no-op.
2021-03-08 15:01:12 -05:00
Aarif
b58ea1f03c replaced unittest assertions pytest assertions (#26576) 2021-02-22 16:18:51 +05:00
Awais Qureshi
7321e9e5eb BOM-2338
Apply pylint-amnesty.
2021-02-08 17:42:01 +05:00
Kyle McCormick
44d5060c60 Add setting for error'ing on deprecated imports
Deprecated edx-platform import paths
(for example, `student` instead of
`common.djangoapps.student`) currently raise
warnings when used. We want to fully remove
support for those paths.

As an easily reversible way to initially remove
support, we add a new setting to LMS and Studio
called `ERROR_ON_DEPRECATED_EDX_PLATFORM_IMPORTS`,
defaulting to False. We set it to True for devstack
and will set it to True in Stage and Production
soon. If critical errors occur, we can easily
flip the setting back to False.
2021-01-21 10:49:47 -05:00
stvn
39acbf2f21 Implement a new configuration system for discussions plugins
Additional details available in the attached decisions document.

Co-authored-by: Kshitij Sobti <kshitij@sobti.in>
Co-authored-by: stvn <stvn@mit.edu>
2020-12-17 18:23:46 -08: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
Régis Behmo
bad30a157e Upgrade edx-completion and fix corresponding unit tests
Some tests were still relying on deprecated
WaffleSwitchNamespace.override method, which was working before because
we were importing WaffleSwitchNamespace from waffle_utils.__init__. This
no longer works after we import WaffleSwitchNamespace from edx-toggles.
2020-11-09 16:14:50 +01:00
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Régis Behmo
3b127f8c92 Deprecate WaffleSwitch.override* methods
This allows us to get rid of the custom WaffleSwitch and
WaffleSwitchNamespace classes from waffle_utils in favour of
edx_toggles.toggles classes.
2020-11-03 19:25:37 +01:00
Kyle McCormick
090e10683c Rename sys_path_hacks/ to import_shims/
The old folder name is somewhat confusing, because the
folder contains shims to _compensate for the removal
of sys.path hacks_, but does not contain the sys.path
hacks themselves.

Furthermore, this import_shims/ system could also be
used for other import path changes, such as turning
the locally-installed packages in common/lib/
into regular, importable modules
(e.g. `from common.lib.xmodule import abc` instead of
`from xmodule import abc`). So, a name that is not
specific to the sys.path hacks may be better
in the medium-to-long term.

Along the same lines, we also rename SysPathHackWarning
to DeprecatedEdxPlatformImportWarning.
2020-10-30 10:20:48 -04:00
Calen Pennington
4a120a9e26 Fix failures caused by removing lms/djangoapps from sys.path 2020-09-23 10:05:37 -04:00
Soban Javed
b7ca6d5619 Upgrade celery to 4.4.7
Replace django-celery with django-celery-results
Upgrade redis to latest
2020-09-22 16:20:45 +05:00
Sid Verma
99220e0967 Add "Source from library" XBlock
This lets the user import a block from a blockstore-based content library into a (modulestore based) course, by copying the block into the course.
2020-07-24 13:32:37 +05:30
Albert (AJ) St. Aubin
77f3d9099b [MICROBA-437] Add api to determine demographics status based on user data 2020-07-14 12:58:07 -04:00
Dillon Dumesnil
35549f56ba AA-220: Making Library Content an Aggregator CompletionMode
This change will prevent Library Content from being marked as
complete on view and the corresponding version bump to
edx-completion contains code that will start looking at the
children of the library content for completeness.
2020-07-01 17:33:54 -04: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
Daniel Francis
82c0ca0da8 Fixing implicit parser name for Beautiful Soup (lms, openedx) (#24100)
Fixing 56 GuessedAtParserWarnings, in commit edx#24098

Background: BeautifulSoup automatically picks the fastest parser available. By default, it picks the "lxml" parser.

Per the [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser) documentation:

> Beautiful Soup supports the HTML parser included in Python’s standard library, but it also supports a number of third-party Python parsers. One is the lxml parser. Depending on your setup, you might install lxml with one of these commands.
> Another alternative is the pure-Python html5lib parser, which parses HTML the way a web browser does. 

Context: We changed two statements, one in lms and another in openedx. Both statements fire up BeautifulSoup. Now we explicitly ask for "lxml," following the recommendation on BeautifulSoup's documentation:

> If you can, I recommend you install and use lxml for speed. If you’re using a very old version of Python – earlier than 2.7.3 or 3.2.2 – it’s essential that you install lxml or html5lib. Python’s built-in HTML parser is just not very good in those old versions.

Before:
`soup = BeautifulSoup(content)`

After:
`soup = BeautifulSoup(markup=content, features="lxml")`

The warnings are gone, tests are passing in local.
2020-06-18 15:41:07 -04:00
Dave St.Germain
fbc18460ca Add support for external user ids to the xblock user service. 2020-04-29 08:55:40 -04:00
Awais Jibran
804fac9358 Adds retry logic for software secure 2020-04-13 14:14:11 +05:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
Waheed Ahmed
3dc3e10819 Revert "Adds retry logic for software secure." 2020-04-07 20:40:06 +05:00
Awais Jibran
4b22554411 Merge pull request #23514 from edx/aj/ss-retry-logic
Adds retry logic for software secure.
2020-04-07 10:59:57 +05:00
Awais Jibran
4ead215665 Adds retry logic for ss.
1. Created a new celery queue with key `SOFTWARE_SECURE_VERIFICATION_ROUTING_KEY`.
2. Added a celery task with retry logic.
3. sorted imports with isort.
4. Changed deprecated `log.warn` => `log.warning`.
2020-04-06 15:16:56 +05:00
Awais Qureshi
b55e8da882 BOM-1463
Adding missing aap.
2020-04-05 21:09:17 +05:00
Ayub-khan
3c1140dc49 BOM-1045
-Upgrade edx-drf-extensions
-settings-update
2020-03-10 16:06:02 +05:00
Awais Jibran
c6e0985812 Upgrade edx-when in edx-platform
Run `make upgrade` on edx-platform to update python packages.
PROD-1333
2020-03-03 20:01:09 +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
Braden MacDonald
5fc73468b3 Change completion API to work with any learning context 2019-10-22 14:04:31 -04:00
Ayub
f08a7e7268 Merge pull request #22032 from edx/BOM-xblock-recommender-tests-fix
BOM Project Xblock Recommber integration tests fix
2019-10-15 13:03:40 +05:00
Awais Qureshi
f7adc71c44 BOM-924
Fixing TypeError, the JSON object must be str, not 'bytes'.
2019-10-15 12:11:24 +05:00
Ayub khan
f0133d861d BOM Project Xblock Recommber integration tests fix
Python3 json can not work with bytes type input so used simplejson
instead of python json which works with both bytes and unicode
type input.
Previously we mistakenly updated StringIO to six.String io. which
caused the tests failure. Used io.BytesIO to fix the issues as
assci character bytes can not be converted to unicode.
2019-10-14 18:20:42 +05:00
asadazam93
7a43721f81 Upgrade python 3 decode error 2019-10-04 16:17:11 +05:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Jeremy Bowman
553d35e53e Upgrade mock BOM-596 (#21717) 2019-09-24 10:14:17 -04:00
Feanil Patel
f2445cfe36 Turn off hash randomization on the xdist workers as well. 2019-09-06 17:04:17 -04:00
David Ormsbee
9a1385585f Convert response bytes to str before JSON parsing. (#21375)
Convert response bytes to str before JSON parsing.
2019-08-19 11:01:55 -04:00
Diana Huang
bf7dad15e4 Remove microsite djangoapp except migrations and configuration. 2019-08-16 09:42:57 -04:00
aarif
61800c619f replaced StringIO imports with import from six
replaced cStringIO and StringIO imports with import from six

fixed StringIO imports

fixed StringIO imports

fixed XSS python-wrap warning
2019-08-08 00:09:16 +05:00
Calen Pennington
ce058aa5ee Only allow users who have no entitlements to receive discounts 2019-06-25 12:04:59 -04:00
Calen Pennington
2901d5f810 Centralize the strike-out price formatting to make correct accessibility easier 2019-06-18 11:00:08 -04:00
Jeremy Bowman
ff7292538e More pylint fixes (#20692) 2019-05-28 09:19:31 -04:00
aliciaerwin
ddeb7c4204 INCR-237 Run python modernize on openedx/tests (#20494) 2019-05-24 15:46:18 -04:00
Nimisha Asthagiri
eb0791ec89 Inter-app API cleanup for Grades 2019-05-04 11:35:06 -04:00
Nimisha Asthagiri
dfa3728edf Move django_comment_common from common to openedx 2019-05-03 12:10:18 -04:00
Nimisha Asthagiri
ef0e06cc0a Revert "Discussions consolidation" 2019-05-02 14:59:56 -04:00