Commit Graph

561 Commits

Author SHA1 Message Date
zia.fazal@arbisoft.com
ffd6f48557 Ignore ResourceWarning
Ignore `ResourceWarning` to clear noise in logs until we replace `EdxRestApiClient` with `OAuthAPIClient`. We have too many warnings like this
unclosed <ssl.SSLSocket fd=33, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('*.*.*', 47040), raddr=('*.*.*.*', 443)
2020-01-08 15:34:29 +05:00
Diana Huang
c061a9c4a6 Merge pull request #22596 from edx/diana/upgrade-drf
Upgrade DRF to 3.9.4.
2020-01-02 16:09:02 -05:00
Calen Pennington
151b309225 Convert custom storage subclasses into mixins so that we can store to either the filesystem or S3 2020-01-02 14:49:19 -05:00
Diana Huang
976c6873e5 Upgrade DRF to latest version. 2020-01-02 12:18:03 -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
Feanil Patel
f485ff450d Deal with pylint. 2019-12-09 11:03:22 -05:00
Feanil Patel
bf482f4989 Respond to code review. 2019-12-06 15:02:22 -05:00
Feanil Patel
48e9724808 Handle other places where we might be unpickling things.
We use pickling in conjunction with caches in these cases so we should
be able to fallback to the uncached behavior if the pickled data is
corrupt in some way.

eg. it's a python 2 pickle we don't know how to read.
2019-12-05 17:06:12 -05:00
Braden MacDonald
1ea3c032d3 Fixes for the blockstore API client / XBlock runtime under python 3 2019-12-05 09:24:24 -08:00
David Ormsbee
6ba9cd2140 Merge pull request #22035 from open-craft/blockstore-assets
APIs for XBlock static asset files in Blockstore
2019-11-08 15:28:59 -05:00
Kyle McCormick
4f3262a40b Remove most references to old teams config scheme (#22238)
This is a follow up from MST-16, which was commited
in 3858036a4e.

Changes:
* Enrich course teams_configuration from a plain Dict
  to a custom XBlock field that uses the new TeamsConfig
  wrapper class.
* Remove teams_conf property from course, as the previous
  change made it redundant.
* Update teams_enabled implementation.
* Remove teams_max_size field from course, which is
  no longer semantically correct, as max team size
  is now defined on a teamset level.
* Remove teams_topics in order to discourage use of raw
  teams config dict.
* Add convenience properties teamsets and teamsets_by_id
  to course.
* Allow periods and spaces in teamset IDs to avoid breaking
  existing course teams.

Some parts of the code still use the old raw config data
(identifiable by searching "cleaned_data_old_format"),
which we expect to be slowly factored away as we build
new teams features. MST-40 has been created to remove any
remaining references if necessary.

MST-18

* fix: bokchoy test

* fix: remove pdb break
2019-11-06 20:43:32 -05:00
Braden MacDonald
7dafda6168 Support for storing an XBlock's static asset files in Blockstore
This PR introduces some backend python + REST APIs for storing static
asset files along with an XBlock in a content library. It also updates
the new runtime to be able to load such static asset files.

Example use cases:
* Store an image file with an HTML block and then use the image inline
  in the HTML block.
* Store a PDF file with an HTML block and provide a link in the HTML for
  the learner to download the PDF.
* Store .srt files or even video .mp4 files that belong to a video
  XBlock.

Within the bundle, these static asset files are stored in a "static/"
subfolder of the folder that contains the OLX file. Extending an
existing LMS/Studio convention, a static asset file such as "image.png"
is referenced within the OLX as "/static/image.png" and the URL will be
rewritten by the runtime.
2019-11-06 10:19:42 -08:00
Ned Batchelder
eab54563dc Merge pull request #22212 from edx/nedbat/more-rounding-tests
Add more tests of the new round()
2019-11-01 12:46:32 -04:00
Diana Huang
6fb40586fb Move LoginSessionView from user_api to user_authn 2019-11-01 08:19:55 -04:00
Ned Batchelder
0fc8bb5e4b Add more tests of the new round() 2019-11-01 07:47:12 -04:00
Feanil Patel
ab40748b5a Add an implementation of python2 style round.
Python 3 has no way to access this implementation of rounding in the
standard library.  We implement it here so that we can continue to use
it for grades calculation to keep regrading consistent.

Currently we can't be confident that if we change the rounding behaviour
we won't impact students.  We can't be sure that students that were
previously passing wouldn't suddenly no longer be passing.  Given this,
it's lower risk to just implement the old rounding strategy here and use
it when we are rounding to calculate grades.
2019-10-31 14:29:57 -04:00
Kyle McCormick
3858036a4e Expand and refactor teams configuration on course. (#22168)
Wrap CourseModule.teams_configuration in TeamsConfig
class, centralizing parsing, validation, error handling,
etc. Wrapped object is exposed on 'teams_conf' field.

Old code still uses 'teams_configuration' dict;
we should change this in the future (MST-18).

MST-16
2019-10-29 16:10:19 -04:00
Braden MacDonald
5fc73468b3 Change completion API to work with any learning context 2019-10-22 14:04:31 -04:00
Ayub khan
b3c062be1b BOM-848 Different Hash Values
hashlib produces different md5 hash in python3 against same values as
compared to python2.
2019-10-21 14:02:49 +05:00
Feanil Patel
05ab349c88 Merge pull request #22068 from edx/feanil/get_out_of_a_pickle
Create a custom Pickle Serializer
2019-10-18 14:48:24 -04:00
Feanil Patel
bfc02dc3ab Create custom pickle serializer.
We need to do this because when I tride to go to the JSON serializer a
bunch of tests started failing because various parts of our code are
putting things into the session that are not JSON serializable.

We can't keep using the default pickle serializer because it defaluts to
using the highest available protocol and that will cause issues with the
python 2 to 3 upgrade since both will be running in production at the
same time.  We need to use a version of the pickle protocol that both
can use interchangably.

We also need to make sure we read with latin1 encoding to make datetimes
work correctly between the two versions of python.
2019-10-18 13:46:47 -04:00
Feanil Patel
59b0554c37 Update encoding to be latin1 when loading pickled data to be able to read python 2 datettimes. 2019-10-18 13:04:19 -04:00
Feanil Patel
29cc071edd Set cache pickle protocol to 2.
HIGHEST_PROTOCOL will cause it to change when we move from python 2 to 3
and this may cause issues as older machines try to read objects pickeld
with a version of the protocol they don't know.

During deploys, and if we have to roll back are two examples.
2019-10-18 10:43:04 -04:00
aarif
d176957708 Updated the tests to fix the string/bytes input
changes made to pass tests with python 2 and other minor changes

Updated the tests to fix the string/bytes input

changes made to pass tests with python 2 and other minor changes

made some changes as suggested

made changes as suggested

changes made as suggested
2019-10-14 18:47:18 +05:00
Awais Qureshi
ae9dcdef8a BOM-917
Fix encoding issue.
2019-10-11 20:12:34 +05:00
jinder1s
2c6b2f32dd converting unicode to byte where necessary 2019-10-04 11:13:11 -04:00
jinder1s
3dc35dc09c Explicity creating byte strings 2019-10-01 13:43:45 -04:00
noraiz-anwar
67af4b8eb1 fix course import issue 2019-09-26 18:00:21 +05:00
Jeremy Bowman
23870802c6 Replace usage of UUID.get_hex() - BOM-672 2019-09-19 10:32:23 -04:00
edx-pipeline-bot
38cc1f0ab7 Merge pull request #21586 from edx/private_to_public_f98c819
Mergeback PR from private to public.
2019-09-06 12:32:38 +05:00
Awais Jibran
f98c819f74 Merge pull request #160 from edx/aj/add-noopener-to-new-window-urls
Update hyperlinks in platfrom
2019-09-06 11:43:38 +05:00
Alex Dusenbery
6917a29e84 PROD-287 | Add an optional treat_undefined_as_zero flag to the helper functions is_score_higher_or_equal() and compare_scores(), which defaults to False, that we call with value True from SubsectionGradeFactory.update(), which occassionally deals with invalid subsection scores containing zero as the denominator. 2019-09-05 09:31:23 -04:00
aarif
929d73bd88 python 3 fixes 2019-09-03 20:33:22 +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
Awais Jibran
1a4eb7d2e8 Pervent reverse tabnabbing in edx platform 2019-08-28 16:08:34 +05:00
noraiz-anwar
1c4f9da92d improved quality of multiple files 2019-08-22 12:47:08 +05:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Feanil Patel
68933ec089 Fix quality issues. 2019-08-19 11:51:30 -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
Nimisha Asthagiri
b80fd1f843 Fix for 'UUID' object has no attribute 'get_hex' in openedx/core/lib/xblock_utils/__init__.py 2019-08-19 10:36:43 -04:00
Feanil Patel
269a57445d Fix a few issues we run into when running the discussion tests. 2019-08-19 10:14:29 -04:00
Feanil Patel
f5f875401a Fix some of the common test collection issues. (#21340)
* Remove old  performance tests that we haven't been running.

As far as I can tell, these tests to capture HAR files were created 5
years ago and not being run as a part of our suite?  They capture HAR
data that we do nothing with so even if they were running we should
remove them until we're ready to care about consuming this kind of
information.

* Update password test unicode string.
* Add ugettext translation helper function.
* Fix lambda syntax that is not valid in python 3.
* Fix ur raw strings which his not valid in python 3
* Use edx_six.get_gettext instead of ugettext.
* Fix a few other encoding issues.
* Don't use old form of sorted funciton.

This form which uses a 'cmp' method is not available in python 3.
2019-08-16 11:31:36 -04:00
arbisoft
9d87c3c83b python 2 and 3 compatible method. 2019-08-07 17:01:30 +05:00
Michael Roytman
77dc0fa9f0 add number of total users and number of filtered users to the gradebook API 2019-07-24 23:02:04 -04:00
Ayub khan
80f89dc982 INCR-379 python 3 compatibility 2019-07-10 15:13:26 +05:00
usama sadiq
7a5f0b7d24 Pylint Warning Supression Removed 2019-06-27 12:15:06 +05:00