Commit Graph

17706 Commits

Author SHA1 Message Date
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
David Ormsbee
2cb2265ffe Add request caching to reduce ORM queries
This adds request caching to the following places:
* course expiration wrapper (displayed in Units)
* offer banner generation (displayed in Units)
* get_enrollment
* user_by_anonymous_id
* youtube_disabled_for_course

On a sample course with edx-val enabled, this reduced the queries
for a large sequence from 450 to 155.
2019-12-30 16:19:25 -05:00
edX cache uploader bot
e326520c03 Updating Bokchoy testing database cache (#22655) 2019-12-30 15:57:43 -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
39d3a7ca17 Fix pep8 issues caused by the fixer. 2019-12-30 11:42:04 -05:00
Feanil Patel
61e1eda20d Merge pull request #22644 from edx/feanil/2to3_imports
Run `2to3 -f future . -w`
2019-12-30 11:21:05 -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
edX cache uploader bot
a6f374c90b Updating Bokchoy testing database cache (#22640) 2019-12-30 09:55:34 -05:00
Jeremy Bowman
63574e12b8 Remove pytest version constraint (#22626)
Fix the issue that was preventing us from upgrading pytest.  pytest does some manipulation of test packages that prevents `pkg_resources` from loading resources from them, but used to contain a workaround for the problem.  That workaround was [removed](https://github.com/pytest-dev/pytest/issues/5392) in 4.6.0 as a performance enhancement when pytest switched from `pkg_resources` to `importlib-metadata` for its own entrypoint handling.  This tripped up one of our test modules which defined classes that loaded templates from inside a test package.  Moving these resources to the parent package fixes the problem.

More and more, `pkg_resources` is being abandoned in favor of `importlib-metadata` and `importlib_resources` as they have a simpler design with much better performance.  However, `importlib_resources` doesn't support loading files from any directory which isn't itself a Python package (and doesn't allow direct use of paths including directories within the package).  Jinja2 chose a [different approach](https://github.com/pallets/jinja/pull/1082) that we may want to emulate in our resource handling.

Also fixed usage of a removed `pytest.raises()` parameter and a bug in our configuration of the `common/lib` tests that became a problem after the upgrade.
2019-12-30 09:10:57 -05:00
Awais Qureshi
c7c6242a0e Merge pull request #22617 from edx/awais786/BOM-1124
BOM-1124
2019-12-30 15:09:27 +05:00
Zainab Amir
257c635a68 Fix Targeted Feedback HTML (#22606)
etree.tostring returns bytes instead of string which when converted
back to XML, to be rendered as etree element, presents stray
characters.

PROD-1116
2019-12-30 15:06:02 +05:00
Awais Qureshi
804a84f9cf BOM-1124
Direct assignment to the forward side of a many-to-many set is deprecated Fixing this issue.
2019-12-28 00:04:15 +05:00
Feanil Patel
59808c82f1 Merge pull request #22611 from edx/feanil/fix_mathjax_bug
Don't try to typset mathjax if Hub has not loaded.
2019-12-27 11:22:22 -05:00
edX cache uploader bot
1cbe81f747 Updating Bokchoy testing database cache (#22614) 2019-12-27 09:19:10 -05:00
edX cache uploader bot
fe1f69741e Updating Bokchoy testing database cache (#22608) 2019-12-26 16:39:55 -05:00
Feanil Patel
ff40369990 Don't try to typset mathjax if Hub has not loaded.
In our tests there are times when Mathjax has been initialized but
Hub is still undefied.  In this case don't queue up typesetting.
2019-12-26 16:13:58 -05:00
Jeremy Bowman
b2046f6674 Switch make upgrade to Python 3.5 (#22609)
* Switch make upgrade to Python 3.5

* bok-choy fixes, constrain django-debug-toolbar

* Remove flaky bok-choy test
2019-12-26 15:13:02 -05:00
David Ormsbee
10cc7895bd Merge pull request #22607 from appsembler/omar-matej/fix-image-ratio-studio
fix uploaded image aspect ratio in tinymce
2019-12-26 12:33:27 -05:00
Feanil Patel
f359c9cd8f Merge pull request #21197 from open-craft/giovanni/upgrade-pymongo
BB-1744: Bump pymongo version and fix course export issue
2019-12-26 11:16:15 -05:00
David Ormsbee
a4b64c3a79 Merge pull request #21166 from open-craft/guruprasad/fix-courseenrollment-mode-default
[BB-1506] Use a callable as the default value for CourseEnrollment.mode
2019-12-26 10:25:27 -05:00
Matej Grozdanović
4b2bf9c4ac fix uploaded image aspect ratio in tinymce 2019-12-26 16:39:39 +03:00
Adeel Khan
51da469762 Fix html editor for adding �
This patch would fix html editor
for adding � characters in
html attributes whenever cursor
is inside quotes. � characters
are added on save.

PROD-1076
2019-12-23 15:47:48 +05:00
Andytr1
b1b5403041 Merge pull request #22559 from edx/andytr1/studio_teamsconfiguration_svc
EDUCATOR-4846 - added team config service for xblocks.
2019-12-20 10:46:04 -05:00
atesker
e0d57fe1a7 EDUCATOR-4846 - added team config service for xblocks.
Quality / encoding

Remove comments

remove debug

Changed service implementation to make unit testing easier

Corrected service

code style

unit test cleanup

Clean up imports
2019-12-20 09:57:30 -05:00
Braden MacDonald
f31dc19887 Support anonymous users in the Blockstore-based XBlock runtime
Implementation details:
* Anonymous users are assigned a unique ID (like 
  `anon42c08f9996194e2a9339`) which gets stored in the django session.
  `block.scope_ids.user_id` and `block.runtime.anonymous_student_id`
  will both return this value.
* User state for anonymous users is stored in the django cache and
  automatically expires as the cache gets pruned. Because user state is
  stored, anonymous users can use interactive blocks like capa problems.
* There is no mechanism for upgrading to a registered account and
  keeping user state since the user state store for anonymous users
  (EphemeralKeyValueStore) is completely different than the one for
  registered users (DjangoKeyValueStore/"CSM"), and has no "list all
  keys" functionality.
* "User State Summary" field values are shared among [recently active]
  anonymous users but are not shared with registered users.
* Anonymous users can only access the `public_view` of XBlocks, not the
  regular `student_view`.
2019-12-19 16:12:24 -08:00
Calen Pennington
529b2312db Merge pull request #22582 from cpennington/pull-in-overwrite-storage
OverwriteStorage was removed from django-storages, so pull it into ed…
2019-12-19 14:49:15 -05:00
edX cache uploader bot
cb40d75437 Updating Bokchoy testing database cache (#22579) 2019-12-19 14:40:53 -05:00
Calen Pennington
c83d0e2ca8 OverwriteStorage was removed from django-storages, so pull it into edx-platform (for now?) 2019-12-19 14:06:30 -05:00
David Ormsbee
a09c4e160b Merge pull request #22538 from open-craft/blockstore-video-transcripts
Support transcript files for video XBlocks in Blockstore
2019-12-19 11:24:27 -05:00
Aarif
10a00f8c98 Merge pull request #22508 from edx/BOM-1082
Updated the django-countries to support Django 2.2
2019-12-19 12:15:04 +05:00
edX Transifex Bot
0b7b62ae7f geoip2: update maxmind geolite country database 2019-12-18 16:13:47 -05:00
Dillon-Dumesnil
50534a8844 Merge pull request #22566 from edx/ddumesnil/disco-1522
DISCO-1522: check if enrolled before congrats message
2019-12-18 20:31:41 +00:00
Dillon Dumesnil
7165eeff44 DISCO-1522: check if enrolled before congrats message
This helps out the Verified Only case where the user
is not first enrolled as an audit learner.
2019-12-18 19:54:28 +00:00
Jeremy Bowman
072b3c11a1 Upgrade edx-ace and edx-django-sites-extensions (#22535) 2019-12-18 14:07:20 -05:00
edX cache uploader bot
0e5f95c8bc Updating Bokchoy testing database cache (#22557) 2019-12-18 14:02:42 -05:00
aarif
d81af828fb updated the django-countries to version that supports django 2.2
updated the tests

minor changes

changes made verify capitalized country code

changes made verify capitalized country code

changes made stay consistent with country code implementation

changes made to test with previous implementation

updated the django-countries version to latest

updated the tests input to match the output

updated the constants to use updated country names according to new ISO standards
2019-12-18 18:40:48 +05:00
Hassan Javeed
596cbbdf6c Add history to CourseEntitlementSupportDetail 2019-12-17 19:10:45 +05:00
Robert Raposa
c5f44bf20e update READMEs to clarify responsibilities
Add some clarifications for student, user_api, and user_authn given
the recent clean-up of moving code to the appropriate apps.

ARCH-1248
2019-12-16 13:51:43 -05:00
edX cache uploader bot
95a015a388 Updating Bokchoy testing database cache (#22540) 2019-12-16 10:06:04 -05:00
Robert Raposa
b2be6b3ba2 Merge pull request #22513 from edx/robrap/ARCH-1253-login-user-post-only-take-3
ARCH-1253: require POST for login_user
2019-12-15 15:59:00 -05:00
Braden MacDonald
e4eac68e9f Support transcript files for video XBlocks in Blockstore 2019-12-15 12:35:03 -08:00
Robert Raposa
3505492fff require POST for login_user
ARCH-1253
2019-12-15 11:20:06 -05:00
Diana Huang
95ff97e87d Merge pull request #22532 from edx/diana/transcript-handling
Standardize input into SubRipFile
2019-12-13 14:07:15 -05:00
edX cache uploader bot
595b2ce529 Updating Bokchoy testing database cache (#22531) 2019-12-13 13:34:40 -05:00
Diana Huang
217228dffc Standardize input into SubRipFile. 2019-12-13 13:28:27 -05:00
Feanil Patel
1411ef548c Merge branch 'master' into release-mergeback-to-master 2019-12-13 10:28:35 -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