Commit Graph

3524 Commits

Author SHA1 Message Date
David Ormsbee
47e606b3ca Find the courses a user has certs for up front.
Before this commit, we had to do a separate query for every course a
user was enrolled in when determining whether a course was refundable
(if you have a certificate, it isn't). Now the student dashboard will
make a one-time query to grab all of a user's cert-issued courses. This
is indexed, so it should be much faster than grabbing each one
separately.
2017-02-23 22:24:00 -05:00
Clinton Blackburn
9d9cf1a84b Added support for JWT authentication to the Enrollment API
ECOM-7099
2017-02-23 18:20:36 -05:00
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
527774ef1a Merge pull request #14545 from edx/ormsbee/enrollment_select_related_user
Select related users when returning enrollments.
2017-02-23 11:53:38 -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
Matt Drayer
685524bb70 Merge pull request #14541 from edx/mattdrayer/direct-idp-login
ENT-228: Allow tpa_hint to match hidden providers
2017-02-22 17:10:54 -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
Matt Drayer
6e661404a4 mattdrayer/direct-idp-login: Allow tpa_hint to match hidden providers 2017-02-21 14:57:43 -05:00
Ben Patterson
c0dd2b878f Lettuce-on-Xenial CMS fix. Iterate through a list to avoid quotation string confusion.
Also change some selenium settings (they were not necessary at this time).
2017-02-20 17:22:36 -05:00
Ben Patterson
0e596dd517 Multi-thread stub servers. 2017-02-20 17:22:23 -05:00
Ben Patterson
e7b0c28d57 Fixes for chrome reliability in selenium.
Fix for rendering timing issue. See https://bugs.chromium.org/p/chromedriver/issues/detail?id=1552
2017-02-20 17:22:02 -05:00
Ben Patterson
452a1f1fbb Refactor click since it was resulting in timeout errors; use correct id for one of the LTI stub's buttons. 2017-02-20 17:21:42 -05:00
Ben Patterson
c58e514231 Properly wait for LTI stub's buttons to render 2017-02-20 17:21:41 -05:00
Ben Patterson
c3887b0b6b Fix lettuce tests for Xenial compatibility and newer Chrome version. 2017-02-20 17:21:29 -05:00
David Ormsbee
351c34816c Select related users when returning enrollments.
Modify CourseEnrollment.enrollments_for_user to select the related user
object. This saves us from a bunch of redundant queries on the student
dashboard.
2017-02-20 09:38:44 -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
Ned Batchelder
833f82dce9 Merge pull request #14519 from edx/nedbat/idempotent-email-uniqueness-constraint
An idempotent migration to add an email uniqueness constraint
2017-02-16 09:58:07 -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
Ned Batchelder
98b250b66e A new django app for unicorn migrations 2017-02-15 11:40:05 -05:00
Ned Batchelder
04557bbff3 Make this no-op migration be a true no-op. 2017-02-15 07:16:10 -05:00
Ned Batchelder
169414b734 An idempotent migration to add an email uniqueness constraint 2017-02-15 07:16:10 -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
Ned Batchelder
1e6a74e777 No-op a migration that needs to be more clever 2017-02-14 10:01:03 -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
Ahsan Ulhaq
d141eb15b1 Added unique constraint on email
ECOM-7085
2017-02-10 21:24:15 +05:00
Jesse Shapiro
424b4356a5 Merge pull request #14400 from open-craft/haikuginger/enterprise-course-consent
[ENT-101] Add course-specific data sharing consent hooks for Enterprise app
2017-02-09 18:37:55 -05:00
Renzo Lucioni
dda0e03f65 Merge pull request #14488 from edx/renzo/finish-catalog-transition
Finish transition to catalog for program data
2017-02-09 16:10:44 -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
9a573de533 Add consent check to course access prerequisites; add utility functions to provide interface to course-specific consent in Enterprise app 2017-02-09 13:49:57 -05:00
Jesse Shapiro
358e73c082 Remove data sharing consent from logistration 2017-02-08 13:04:54 -05:00
Troy Sankey
6ed8dcda2c Merge pull request #14479 from edx/pwnage101/update-custom-metrics-docstrings
improve docstrings for newrelic_custom_metrics middleware
2017-02-07 11:24:08 -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
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
Troy Sankey
cb122fc027 improve docstrings for newrelic_custom_metrics middleware
Additional comments in this commit clarifies an additional use-case for
the newrelic_custom_metrics.accumulate function: reporting a metric
without accumulation.  Also:

* Fixes docstring style to use the "google" style.
* Adds link to custom metrics table in the wiki in an attempt to help
  keep the tables in sync with the code.
* Inserts a TODO.
* other typos.
2017-02-06 17:17:51 -05:00
David Ormsbee
da5a8b5540 New Relic metric: Enrolled courses on dashboard.
This is so we can better map how student dashboard performance maps to
number of enrolled courses.
2017-02-06 11:24:14 -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
Vedran Karacic
7fe8e47554 [SOL-2133] Add user deactivation endpoint. 2017-01-31 11:34:26 +00:00
Saleem Latif
ab88da952b Update settings for edx-enterprise (v0.19.1) configurations. 2017-01-31 14:19:51 +05:00
asadiqbal
8f5ba0115c WL-606 2017-01-25 15:05:57 +05:00
Renzo Lucioni
4c9066cf4e Use switch to pull programs from the catalog for the student dashboard
ECOM-4422
2017-01-23 15:57:59 -05:00
Eric Fischer
4b794372cd Add registration tracks as valid bulk_email targets
Hackathon XV project
2017-01-12 15:05:49 -05:00
Anthony Mangano
38d8017db4 more pylint fixes 2017-01-09 12:38:18 -05:00
Anthony Mangano
8e1eafd1d4 test fix 2017-01-09 11:34:05 -05:00
Anthony Mangano
4de65abbaa pylint fixes 2017-01-09 11:33:04 -05:00
Anthony Mangano
6296b0c968 clean up tests for feedback form view 2017-01-06 21:44:59 -05:00
Anthony Mangano
d3afb3c1c2 dont send blank course_ids to Zendesk or Datadog 2017-01-06 18:15:19 -05:00