Commit Graph

3988 Commits

Author SHA1 Message Date
David Ormsbee
8423ecb1c8 Student Dashboard CourseOverviews with one query.
Pre-load the course overviews attached to CourseEnrollments on the
Student Dashboard, if possible. This will only grab the CourseOverviews
that already exist, and will not generate new ones. Any missing
CourseOverviews fall back to the lazily-created one-at-a-time behavior
they've always had. That's mostly because I wanted to optimize for the
common case in the least invasive way possible, and I don't want to get
caught up in locking issues.
2017-02-23 15:50:44 -05:00
David Ormsbee
2051c90924 Test Speedup: Isolate Modulestore Signals
There are a number of Django Signals that are on the modulestore's
SignalHandler class, such as SignalHandler.course_published. These
signals can trigger very expensive processes to occur, such as course
overview or block structures generation. Most of the time, the test
author doesn't care about these side-effects.

This commit does a few things:

* Converts the signals on SignalHandler to be instances of a new
  SwitchedSignal class, that allows signal sending to be disabled.

* Creates a SignalIsolationMixin helper similar in spirit to the
  CacheIsolationMixin, and adds it to the ModuleStoreIsolationMixin
  (and thus to ModuleStoreTestCase and SharedModuleStoreTestCase).

* Converts our various tests to use this new mechanism. In some cases,
  this means adjusting query counts downwards because they no longer
  have to account for publishing listener actions.

Modulestore generated signals are now muted by default during test runs.
Calls to send() them will result in no-ops. You can choose to enable
specific signals for a given subclass of ModuleStoreTestCase or
SharedModuleStoreTestCase by specifying an ENABLED_SIGNALS class
attribute, like the following example:

    from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

    class MyPublishTestCase(ModuleStoreTestCase):
        ENABLED_SIGNALS = ['course_published', 'pre_publish']

You should take great care when disabling signals outside of a
ModuleStoreTestCase or SharedModuleStoreTestCase, since they can leak
out into other tests. Be sure to always clean up, and never disable
signals outside of testing. Because signals are essentially process
globals, it can have a lot of unpleasant side-effects if we start
mucking around with them during live requests.

Overall, this change has cut the total test execution time for
edx-platform by a bit over a third, though we still spend a lot in
pre-test setup during our test builds.

[PERF-413]
2017-02-23 10:31:16 -05:00
Nimisha Asthagiri
30b5822b0e Storage-backed versioned Block Structures: Config 2017-02-23 09:04:53 -05:00
edx-pipeline-bot
95aa2b61ba Merge pull request #14549 from edx/release-mergeback-to-master
Merge release back to master
2017-02-22 10:08:23 -05:00
Hasnain
2f1d405146 Set 'created_on_site' UserAttribute on account creation.
We need to be able to track which site a given user account was created on. This
change will create a UserAttribute model with a key of 'created_on_site' and a value
containing the domain of the site on which the user accounted was created.

WL-977
2017-02-22 05:12:21 -05:00
Simon Chen
c38de9638c Revert "edx.org/login?next= should not be able to point to an asset"
This reverts commit bc418c47c5.
2017-02-17 14:53:57 -05:00
Douglas Hall
bd678b4a17 Merge pull request #14531 from edx/hasnain-naveed/WL-979
WL-979 | fix the "get_value_for_org" for str and list org.
2017-02-16 10:25:01 -05:00
Hasnain
679f01303b fix the "get_value_for_org" for str and list org. 2017-02-16 16:26:17 +05:00
Ahsan Ulhaq
bc418c47c5 edx.org/login?next= should not be able to point to an asset
ECOM-6463
2017-02-16 14:44:01 +05:00
Jesse Shapiro
5d068cec1f Merge pull request #14496 from open-craft/haikuginger/remove-consent-from-logistration
[ENT-173] Remove data sharing consent from logistration
2017-02-14 11:51:53 -05:00
Douglas Hall
3055f9b259 Merge pull request #14339 from edx/hasnain-naveed/program-backend/WL-912
WL-766 Program marketing page data layer
2017-02-14 04:53:53 -05:00
Hasnain
41f3bba058 Backend code for program detail page.
This adds functions to the catalog utils which munge data
collected from the program endpoint and LMS database to construct
data structures that are ready for use by view and templates
related to the Open EdX marketing pages that live in LMS.

WL-766
2017-02-13 20:37:56 -05:00
Douglas Hall
58f0154ee2 Add support for multi-org sites
WL-926
2017-02-13 19:33:47 -05:00
Ayesha Baig
61f2067935 [YONK-513]: Add feature flag which allows for disabling of account creation 2017-02-13 12:28:57 +05:00
J. Cliff Dyer
be8a898e68 Add logging to recalculate grades base task.
TNL-6294

* Use external celery_utils in edx-platform (TNL-6454)
* Remove old openedx.core celery_utils implementation.
2017-02-10 16:07:51 -05:00
Renzo Lucioni
0e06e90599 Finish transition to catalog for program data
Updates Mako and Underscore templates as well as Backbone models and views so they work with catalog programs. Removes all remaining response munging from the back end.

ECOM-4422
2017-02-09 14:51:26 -05:00
Jesse Shapiro
358e73c082 Remove data sharing consent from logistration 2017-02-08 13:04:54 -05:00
Renzo Lucioni
9be3191829 Merge pull request #14462 from edx/renzo/programs-from-catalog
Load all programs from the catalog
2017-02-07 10:42:17 -05:00
Vedran Karacic
036e05964f User deactivation endpoint should use JWT auth. 2017-02-07 14:45:20 +00:00
Renzo Lucioni
e7771148b7 Load all programs from the catalog
This commit contains back end changes necessary to load programs from the catalog in all contexts. The existing program munging utility is applied as late as possible to avoid conflating this work with changes to the front end; those will be made separately.

ECOM-4422
2017-02-06 23:16:29 -05:00
Douglas Hall
06fa13f4df Allow for customization of course email template at the organization level 2017-02-06 14:23:58 -05:00
Renzo Lucioni
fc6d9519d2 Make service URLs optional on programs config model
We're moving away from this config model and no longer need to specify these URLs.

ECOM-4422
2017-02-04 23:35:06 -05:00
Douglas Hall
450d35a799 Revert "Added instructor info in course overview."
This reverts commit 180cf299a3.
2017-02-03 11:30:17 -05:00
Hasnain Naveed
f9365a2460 Merge pull request #14440 from edx/hasnain-naveed/instructor-info-in-courseoverview/WL-912
WL-912 | Added instructor info in course overview model.
2017-02-02 15:16:06 +05:00
Nimisha Asthagiri
1912176c5a Merge pull request #14438 from edx/beryl/cohort_integrity_error
Fix cohort IntegrityErrors
2017-02-01 15:35:21 -05:00
Hasnain
180cf299a3 Added instructor info in course overview. 2017-02-01 15:19:52 +05:00
Clinton Blackburn
1189867dd2 Removed references to ECOMMERCE_API_SIGNING_KEY
We should not be using custom signing keys for each service at this time. We may want to return to this strategy in the future; but, this is not the direction any of our other services are going in.

ECOM-6541
2017-02-01 01:51:21 -05:00
Nimisha Asthagiri
95b4cbbcf8 Fix cohort Integrity Errors
TNL-5725
2017-01-31 22:56:56 -05:00
Renzo Lucioni
4027dd8444 Use the catalog for program certificate backpopulation
This command is used to backfill missing program certificates. Formerly, it used the programs service. It now uses the catalog service exclusively.

ECOM-4422
2017-01-31 14:20:49 -05:00
Vedran Karacic
7fe8e47554 [SOL-2133] Add user deactivation endpoint. 2017-01-31 11:34:26 +00:00
Renzo Lucioni
2adb03ec8d Merge pull request #14417 from edx/renzo/update-catalog-factories
Update catalog factories
2017-01-28 12:25:25 -05:00
Renzo Lucioni
87ff585ef9 Update catalog factories
More accurately represent serialized catalog data. Also switch to using Faker.

ECOM-4422
2017-01-28 00:50:01 -05:00
Renzo Lucioni
31f5c8ddcb Remove the program admin tool from Studio
All programs are now managed using the Django admin on the catalog service. This is the first in a series of commits removing use of the old programs service from edx-platform.

ECOM-4422
2017-01-27 19:33:06 -05:00
David Ormsbee
41ea1383d4 Merge pull request #14399 from edx/ormsbee/csm_crawler_locking
Disable student state writes for crawlers.
2017-01-27 12:28:11 -05:00
Renzo Lucioni
4391a577c2 Fix program credential backpopulation command
This command was updated to request programs from the catalog, but it wasn't changed to deal with the new response structure. I'm updating all code in the LMS to deal with catalog service responses separately.

ECOM-6900.
2017-01-26 20:40:37 -05:00
Eric Fischer
d4df42687e Merge pull request #14381 from edx/efischer/xml_cache_logging
Log course on no-retry update_course_in_cache errors
2017-01-26 14:01:18 -05:00
David Ormsbee
5ef1e08050 Disable student state writes for crawlers.
When crawlers like edX-downloader make requests on courseware, they are
often concurrently loading many units in the same sequence. This causes
contention for the rows in courseware_studentmodule that store the
student's state for various XBlocks/XModules, most notably for the
sequence, chapter, and course -- all of which record and update user
position information when loaded.

It would be nice if we could actually remove these writes altogether
and come up with a cleaner way of keeping track of the user's position.
In general, GETs should be side-effect free. However, any such change
would break backwards compatibility, and would require close
coordination with research teams to make sure they weren't negatively
affected.

This commit identifies crawlers by user agent (CrawlersConfig model),
and blocks student state writes if a crawler is detected. FieldDataCache
writes simply become no-ops. It doesn't actually alter the rendering
of the courseware in any way -- the main impact is that the blocks
won't record your most recent position, which is meaningless for
crawlers anyway.

This can also be used as a building block for other policy we want to
define around crawlers. We just have to be mindful that this only works
with "nice" crawlers who are honest in their user agents, and that
significantly more sophisticated (and costly) measures would be
necessary to prevent crawlers that try to be even trivially sneaky.

[PERF-403]
2017-01-26 09:36:53 -05:00
J. Cliff Dyer
df7c2715d3 Create infrastructure for reapplying tasks
and cleaning up tasks that have been resolved.

TNL-6252
2017-01-25 16:22:40 -05:00
Eric Fischer
0dd617897b Log course on no-retry update_course_in_cache errors 2017-01-25 12:41:39 -05:00
Renzo Lucioni
21cd5c8014 Ignore run publication status when requesting programs from the catalog
The programs service has no concept of run publication status. The catalog does, and many runs returned by the programs service are marked as unpublished in the catalog. To maintain existing behavior and continue displaying these runs as part of their respective programs, we need to ignore their publication status.

ECOM-6925
2017-01-25 11:34:16 -05:00
Nimisha Asthagiri
784ef04221 Merge pull request #14359 from edx/beryl/command_generate_cb_tasks
Update generate_course_blocks management command to enqueue tasks.
2017-01-24 17:24:30 -05:00
Nimisha Asthagiri
c04f4401dc Update generate_course_blocks management command to enqueue tasks 2017-01-24 09:11:57 -05:00
Clinton Blackburn
9ab93d1fe2 Disabled system checks for the compile_sass management command
The system checks require database access, which is not available when building Docker images. This relaxes the check, allowing the command to execute without a database.

ECOM-6634
2017-01-23 23:47:17 -05:00
Nimisha Asthagiri
408ed01b1d Block Structure: Don't invalidate immediately upon course publish
Introduces the use of Waffle to put the change behind a Switch.
TNL-6323
2017-01-23 11:27:30 -05:00
Renzo Lucioni
acef28c70c Merge pull request #14259 from edx/ECOM-6535
ECOM-6535 Change celery task to only pull from catalog and not programs api
2017-01-20 15:55:57 -05:00
Matthew Piatetsky
05b461824e Pull programs from catalog when issuing program credentials
Lays the groundwork for pulling all program data from the catalog.

ECOM-6535
2017-01-20 14:48:43 -05:00
cahrens
a6776f6973 Always check group access when masquerading.
TNL-6050
2017-01-19 14:47:10 -05:00
jareerahsan
7baecd3a41 Merge pull request #14317 from edx/jareer/ecom-2963-added-new-fields-in-email-opt-out
Added username and user_id in opt out email csv.
2017-01-18 22:26:19 +05:00
J. Cliff Dyer
f33832a691 scoutrule: dedupe skip_unless_lms 2017-01-18 09:43:46 -05:00
J. Cliff Dyer
0d2ae5d4af Store failed subsection grade calculations
TNL-6250
2017-01-18 09:43:07 -05:00