Commit Graph

509 Commits

Author SHA1 Message Date
Nick
10ac2780de Merge pull request #24733 from edx/ndalfonso/AA-287-cta-events
AA-287 cta events
2020-08-12 09:37:13 -04:00
Manjinder Singh
c76ed6ae45 Extracting plugin app from edx-platform (#24678)
* Moving plugins infrastructure to edx-django-utils
This PR extracts the code that enables plugins in edx-platform and puts it in edx-django-utils. This is done to allow other IDAS to add plugin functionality.
2020-08-12 07:48:53 -04:00
Nicholas D'Alfonso
0211a2b0ff AA-287 cta events 2020-08-10 18:00:13 -04:00
Michael Terry
c2033f9667 Small PLS courseware banner fixes
- Hide the submit-button CTA link to reset dates in the mobile
  app. They are working on their own solution.
- Don't show the dates_banner.html code in the courseware. It has
  new CTA banner support with updated wording.
2020-08-10 09:44:43 -04:00
Calen Pennington
f9619d6cad Add a pluggable CallToAction service for XBlocks
This also has an initial use case for Personalized Learner Schedules
to add CTAs to capa and vertical blocks to allow users to shift their
course deadlines.
2020-08-06 14:38:26 -04:00
Danial Malik
c962423bbc Replace track calls with eventtracking in task_track and server_track (#24282)
* Replace track calls with eventtracking in task_track and server_track

* Making  events compatible with events emitted via track app

* Fixed broken tests and quality violation

* Removed useless changes in shim. using  in  to have  and  keys in event context

Co-authored-by: zia.fazal@arbisoft.com <zia.fazal@arbisoft.com>
2020-06-26 13:49:16 -04:00
adeelehsan
d879f9fd00 Merge pull request #23980 from edx/aehsan/PROD-1582/specify_user_message_for_about_me_in_profile
Specify bio field error message for user
2020-06-10 14:46:04 +05:00
adeelehsan
4e1fe2045f Specify bio message for user
Currently user message is generic. Specifying for
bio field so that it make more sense to user.

PROD-1582
2020-06-10 14:19:39 +05:00
Tim McCormack
881cae6c67 Upgrade Python dependencies, including Django 2.2.13 fix (#24137)
- Updating Python Requirements
- Fix cache key generation to use class name and module

This was stringifying the class object directly, resulting in cache keys
like `:1:<class 'xblock_django.models.XBlockConfiguration'>.xblock_django.api.deprecated_xblocks`
which then cause breakage when Django 2.2.13 validates the keys.

Co-authored-by: edX requirements bot <testeng+edx-requirements-bot@edx.org>
2020-06-05 13:25:54 +00:00
stvn
4490e4ca2b Remove 'View In Studio' link from vertical
in favor of display in the Staff Instructor Toolbar.
2020-06-02 16:00:33 -07:00
Ben Warzeski
d357ec9b7b remove old format from teams_config 2020-05-19 15:34:38 -04:00
Ned Batchelder
5caf9b02fa Merge pull request #23922 from regisb/regisb/fix-offset-naive-static-assets
Fix naive offset-naive/aware error in asset compilation [CRI-191]
2020-05-06 17:13:30 -04:00
Régis Behmo
1d859569b6 Fix naive offset-naive/aware error in asset compilation
The XBlockPackageStorage used to return offset-naive datetime objects
which were compared to offset-aware objects when we ran static asset
collection:

    ./manage.py lms collectstatic

Close CRI-191
2020-05-06 18:39:46 +02:00
Simon Chen
f8cc58618a Create a new plugin manager called DynamicPartitionGenerators to remove the dependency of openedx.features.content_type_gating by xmodule.partition_services 2020-05-04 11:16:26 -04:00
David Ormsbee
431fdb9009 Merge pull request #23233 from open-craft/blockstore-library-links
REST API for managing Content Library bundle links
2020-04-30 11:32:48 -04:00
Robert Raposa
5de9eed420 ARCHBOM-1093: Fix unit test enable-migrations (#23789)
* fix old migrations
* fix a test
* fix enable-migrations cmd argument
* enhance verbose logging to log migrations
* update testing doc with help
2020-04-23 14:04:29 -04:00
Braden MacDonald
81b9453462 API to get/update a content library's blockstore bundle links
This adds some simple new python+REST APIs that can be used to create,
read, update, and delete "links" from a content library to other content
libraries.

One can use these links to import content (XBlocks) into a library
without copying the content.

Note that this feature was already fully supported by Blockstore and the
XBlock runtime; it's just that to use it prior to this required one to
use the (lower-level) Blockstore REST API directly to create the links.
Now there is a somewhat higher-level API built in to Studio, using
"content library" abstractions instead of Blockstore primitives.
2020-04-17 13:07:12 -07:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
Nimisha Asthagiri
7f036af429 Django2 CMSH Router: add clarifying comment 2020-04-01 11:28:23 -04:00
Nimisha Asthagiri
03bb132368 Merge pull request #23564 from edx/arch/django22-fix-csmh-router
Django2 CSMH: Database Router update
2020-04-01 11:20:58 -04:00
Nimisha Asthagiri
8991b161dc Django2 CSMH Database Router update 2020-04-01 09:25:56 -04:00
Tim McCormack
b489a4ecb1 Django2 bytestring conversion: Lynx html_to_text output (#23558)
Fixes test of email body for Django 2.0.
2020-04-01 13:12:25 +00:00
Braden MacDonald
a8d5749b6b Fix: transient S3 errors were not being reported properly
Also improve usefulness of some blockstore runtime logs for debugging

Context:

Sometimes when trying to load an XBlock's XML file from Amazon S3, AWS will return a 4xx or 5xx response along with error XML like:

    <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>foo/bar</Key>...</Error>

A bug in the get_bundle_file_data_with_cache method would cause this XML to be returned to the runtime anyways, as if it were the expected OLX. This would then (obviously) lead to strange parsing bugs, e.g. when trying to interpret <Code> as an <xblock-include>.

This fixes the bug and improves the logging, both to make this sort of issue easier to debug in the future and to return whatever detailed error code S3 provides (or Blockstore, if S3 is not being used).
2020-03-12 16:29:43 -07:00
David Ormsbee
09c5432415 Revert "Fix Blockstore XBlock Runtime's handling of occasional S3 errors" 2020-03-12 15:09:23 -04:00
Braden MacDonald
4ddb02eff8 Fix: transient S3 errors were not being reported properly
Also improve usefulness of some blockstore runtime logs for debugging

Context:

Sometimes when trying to load an XBlock's XML file from Amazon S3, AWS will return a 4xx or 5xx response along with error XML like:

    <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>foo/bar</Key>...</Error>

A bug in the get_bundle_file_data_with_cache method would cause this XML to be returned to the runtime anyways, as if it were the expected OLX. This would then (obviously) lead to strange parsing bugs, e.g. when trying to interpret <Code> as an <xblock-include>.

This fixes the bug and improves the logging, both to make this sort of issue easier to debug in the future and to return whatever detailed error code S3 provides (or Blockstore, if S3 is not being used).
2020-03-11 11:15:59 -07:00
atesker
bf14bc97d2 EDUCATOR-4920 Control permission to REST endpoint
EDUCATOR-4920 Control permission to REST endpoint
CR1

EDUCATOR-4920 Control permission to REST endpoint
CR1
2020-03-03 16:04:31 -05:00
Manjinder Singh
4399d13955 removing all of provider (#23269)
* Revert "Ran make migration on third_party_auth (#23253)"

This reverts commit 49be65cc58.

* Removing provider.util import

* Removing further provider things

* Adding hash tests
2020-03-03 10:42:18 -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
jinder1s
295da79fe5 Remove DOP dispatching from oauth_dispatch.
https://openedx.atlassian.net/browse/BOM-1330
2020-02-27 10:47:06 -05:00
Robert Raposa
372d2e927c BOM-1264: add third-party-auth scope and usage (#23135)
* WIP: add third-party-auth scope and usage

BOM-1264


* Fix tests now that we do permissions in a more standard way.

Rather than manually setting the permission class we previously
explicitly raised a PermissionDenied exception.  The way DRF
permissoning logic works, if we use the WWW-Authenticate header in the
highest priority auth class, it will return a 401 instead of a 403.


* Added test to make sure having permissions gives access to user mapping api

* Test new filters logic.

Ensure that the filters we add to the application access model make it
into the JWT correctly.

* quality fix

* quality fix

* disable pylint warning

* quality fix

* fix indent prob

Co-authored-by: Feanil Patel <feanil@edx.org>
Co-authored-by: Manjinder Singh <49171515+jinder1s@users.noreply.github.com>
2020-02-21 11:25:28 -05:00
Dave St.Germain
a5b0f71108 Several optimizations for improving vertical rendering performance. 2020-02-20 11:41:21 -05:00
Jansen Kantor
0e0b488fb5 EDUCATOR-4876: Correctly handle 'None' as a valid max_team_size (#23038)
add default max team sizes, change ui to not show max for managed teams
2020-02-18 16:44:20 -05:00
Manjinder Singh
d7bd80a100 Renamed OAuth2Authentication to BearerAuthentication (#23128)
* Renamed OAuth2Authentication to BearerAuthentication
* Added back OAuth2Authentication name
-there are libraries such as edx-enterprise that still import OAuth2Authentication.  The OAuth2Authentication class should be fully removed when everything is importing BearerAuthentication correctly
2020-02-18 13:29:29 -05:00
Manjinder Singh
cce8cdd661 Replacing OAuth2Auth (#23067)
- Removing deprecated auth classes
- Replacing OAuth2AuthenticationAllowInactiveUserDeprecated with OAuth2AuthenticationAllowInactiveUser
- the old class was a child class of a deprecated class that we are removing and replacing.
2020-02-11 10:38:13 -05:00
Feanil Patel
1cb5e63246 Rename the serializer to better match its purpose. 2020-02-06 17:05:21 -05:00
Feanil Patel
9f42b5edfe BOM-939 Update pickle procotol version.
Updating to the current highest number instead of making it the default
which is highest know by the language.  This is beacuse when we update
between python versions if there is a new proctocol version, we don't
want that to cause cache thrashing as we try to load things from the
various caches.  We can get into a situation where new machines pickle
things with a newer versions of the procotocl, put them in the cache and
then break older machines that don't know about the new protocol
version.
2020-02-06 16:55:18 -05:00
Manjinder Singh
cea795b02e Added new auth class (#23018)
* Added new auth class

- Created new class called OAuth2AuthenticationAllowInactiveUser, which replaces old class with same name
- Renames previous  OAuth2AuthenticationAllowInactiveUser to  OAuth2AuthenticationAllowInactiveUserDeprecated
- Replaced all imports of  OAuth2AuthenticationAllowInactiveUser to call deprecated class instead
- testing new class in discussion(added flag based on django setting)
2020-02-06 10:37:27 -05:00
Manjinder Singh
e0981025b2 changed oauth2 authentication class in bookmarks app (#22908)
* Added new authentication class(meets drf standards)

The new class replaces the deprecated oauth2authetnication class from rest_framework_auth library(repo django-rest-framework-oauth).
Majority of the code is combination of copy-pasta from old oauth2authentication class and Oauth2AuthenticationAllowInactiveUser class

* Added ability to switch to new authentication class in bookmarks app

* Changed error type reported by Outh class. It now outputs a json rather than a string.
2020-02-04 08:49:26 -05:00
Manjinder Singh
eb694528e7 Adding metrics to oauth2authentication class (#22970)
Currently, we are working on removing the rest_framework_auth library from edx-platform. For this push, we need to remove the oauth2Authentication class. This PR creates a new class oauth2AuthenticationDeprecated that adds additional new relic metrics. The metrics would allow us to see how often this class is used and its success rate. The hope is that this information will help us with transitioning to a different authentication class.
2020-01-30 09:13:51 -05:00
Aarif
97d327feeb BOM-1121
Old style mixin compatibility with django2.2
2020-01-30 16:36:02 +05:00
Kyle McCormick
28c0433352 Reinstate "Remove CourseOverview.get_from_id[s]_if_exists (#22918)"
This reverts commit cdb0619846,
which itself reverted 3ca006214e.

The original commit (3ca006) was reverted because it was suspected
that it was causing unexpectedly-increased memcached usage and
500s in the Gradebook API. It is not clear whether that is actually
the case. We are optimistically reinstating 3ca006 and will monitor
production to see if there is an adverse effect.

MST-105
2020-01-27 11:17:06 -05:00
Kyle McCormick
cdb0619846 Revert "Remove CourseOverview.get_from_id[s]_if_exists (#22918)" (#22926)
This reverts commit 3ca006214e.
2020-01-23 13:52:11 -05:00
Kyle McCormick
3ca006214e Remove CourseOverview.get_from_id[s]_if_exists (#22918)
The functions `CourseOverview.get_from_id_if_exists`
and `CourseOverview.get_from_ids if exists` are bug-
prone, in that they do not go to the modulestore
when a CourseOverview is out-of-date or uncached.
The docstrings spell this out, but callers seem
not to understand the implications.

So, in this commit, we:
* Remove both functions
* Add `CourseOverview.get_from_ids` for almost-as-fast
  yet safer bulk-fetching of overviews
* Update call sites to use `course_exists` or `get_from_ids`
  in place of the old functions.
* Add tests for @verify_course_exists.
This PR should specifically fix an issue where
the program_enrollments API was breaking when the CourseOverview
version was bumped.

CR-1708
2020-01-23 09:41:55 -05:00
M Zulqarnain
4eea92640c Merge pull request #22907 from edx/zulqarnain/BOM-1132
BOM-1132 : Change deprecated storage methods signatures
2020-01-22 14:04:08 +05:00
iamsobanjaved
38493d5092 Removed app_name warning from django.conf.urls.include() 2020-01-21 20:38:27 +05:00
Zulqarnain
644a1fc0a6 Change deprecated methods signatures 2020-01-21 16:33:37 +05:00
Dave St.Germain
cfd1e2ae7d Merge pull request #22707 from edx/dcs/sequence-api
Implementation of metadata endpoint for sequence modules
2020-01-15 10:33:18 -05:00
Dave St.Germain
20235bcf56 Added subsection id to gated metadata. 2020-01-14 10:01:07 -05:00
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