Commit Graph

64 Commits

Author SHA1 Message Date
Ned Batchelder
f54fe787c6 Remove needless 'disable=no-member' pragmas 2015-08-03 17:47:44 -04:00
Renzo Lucioni
4131aa4d38 Allow enrollments in expired modes to be deactivated
Facilitates revocation of enrollments in expired modes. XCOM-490.
2015-07-30 12:39:25 -04:00
Renzo Lucioni
b50c905865 Remove modulestore dependency from Enrollment API
Sets the Enrollment API free of the modulestore by replacing modulestore queries with calls to the CourseOverview model. Course deletion invalidates the corresponding CourseOverview. XCOM-462.
2015-07-20 13:41:19 -04:00
Sylvia Pearce
eea3b31105 Delete white spaces that are causing test failures 2015-07-17 16:12:53 +00:00
Sylvia Pearce
c2420b0940 Final tweaks to API documentation updates 2015-07-15 21:46:11 +00:00
Sylvia Pearce
d2b6ac84d3 Reorganize and update API documentation 2015-07-15 14:31:02 -04:00
Ahsan Ulhaq
8d9d4b85d5 LMS: Modification in enrollment API
Changed enrollment api to set enrollment atributes if the course is
credit course

ECOM-1719
2015-07-07 00:49:02 +05:00
Renzo Lucioni
d330831871 Improve logging of ecommerce interactions
Adds standardized audit logging for checkout and enrollment change requests. XCOM-427.
2015-06-30 17:34:16 -04:00
Bertrand Marron
f19b338170 Shorten long lines to resolve pylint issues 2015-06-24 17:55:24 +02:00
Bertrand Marron
e0ed2d8a3a Fix misleading enrollment API documentation
The user parameter corresponds to the username, not the user ID.
2015-06-24 17:55:24 +02:00
Nickersoft
e184c78c0a XCOM-416: Embargo restrictions are now enforced during logistration 2015-06-23 14:17:43 -04:00
Edward Zarecor
c12c5c926d fixing post-release merge conflicts with DKH 2015-06-10 16:56:21 -04:00
Nickersoft
8c1d3ae412 Added includes_expired parameter to enrollment API
- Adding ?include_expired=1 to course detail requests will now include expired course verifications
2015-06-09 17:12:30 -04:00
jsa
445d0dabb6 Correct deactivation logic in enrollment api and test.
XCOM-396
2015-06-08 11:06:52 -04:00
jsa
445a0c938b Add tests for enrollment deactivation under various modes.
A bug with the creation of inactive honor enrollment modes was caught and fixed along the way.

XCOM-388
2015-06-04 09:40:54 -04:00
Bertrand Marron
e8bf151f3d Fix documentation comment for enrollment API 2015-05-25 16:56:25 +02:00
Renzo Lucioni
960b02cf98 Allow enrollment API to deactivate enrollments
Will allow Otto to revoke fulfillment of course seat products. Only server-to-server calls are currently allowed to deactivate or otherwise modify existing enrollments.
2015-05-18 19:44:02 -04:00
Ned Batchelder
78e9445aa1 Add super() calls to setUp/tearDown that are missing them
Also, I replaced a number of tearDown methods with addCleanup instead.
And also remove some unneeded patch.stopall() calls.
2015-05-14 18:14:21 -04:00
Clinton Blackburn
bfb201ec7d Merge pull request #7822 from edx/clintonb/receipt-page-update
Updated Receipt Page for Oscar
2015-05-02 09:32:11 -04:00
Clinton Blackburn
1a1fe56b29 Added Oscar-Compatible Receipt Page 2015-05-02 00:18:05 -04:00
Will Daly
5d16ed46a2 Enrollment API course details include credit modes.
Credit modes are hidden by default, since the user
isn't allowed to select them on the track selection page.
This commit exposes credit modes through the enrollment
API so that consumers can see that a course has a credit
track.
2015-05-01 12:36:30 -04:00
Mark Hoeber
568ed781c6 Updated enrollment api doc for new response fields
And cleaned up one doctoring
2015-04-23 15:17:47 -04:00
Will Daly
fc918fb3d1 Expose course start/end date in the enrollment API 2015-04-21 08:41:42 -04:00
jsa
46b63164a0 Implement profile_image upload and remove endpoints
TNL-1537

Co-Authored-By: Andy Armstrong <andya@edx.org>
Co-Authored-By: cahrens <christina@edx.org>
2015-04-17 17:23:12 -04:00
Clinton Blackburn
cd5039383e Returning complete URL for Enrollment API user messaging
The Enrollment API now returns the complete URL in the user_message_url field. Returning just the path can result in 404s if the consuming code simply redirects to the value of this field without first checking to see if the hostname is included. Using the full URL solves this problem for all clients.
2015-04-15 11:29:54 -04:00
Clinton Blackburn
e18d69a9e9 Fixed Embargo Bug in Enrollment API
This issue was not found sooner because the test helper used only tested for GeoIP embargoes, and neglected the user profile. An additional test has been added to test for embargoes against the country assigned to the user's profile. Additionally, variable names have been cleaned up--user replaced with username--to avoid confusion in the future.
2015-04-14 22:07:25 -04:00
zubair-arbi
a9b13f0e72 log and ignore invlaid/deleted courses in Enrollment API
ECOM-1273
2015-04-01 16:26:24 +05:00
Brian Wilson
243e2660b0 Merge release to master for 20150317 release. 2015-03-18 18:48:56 -04:00
Stephen Sanchez
4acfbbdf21 Reverting the change to add a 201_CREATED status to the enrollment API. 2015-03-18 20:31:58 +00:00
Stephen Sanchez
8c9f6370b8 Allow Enrollment API supports creating and upgrade course modes other than honor.
Fixing tests, cleaning up POST handler to be easier to read.

Wording fixed for unit test comments.
2015-03-18 17:12:02 +00:00
Stephen Sanchez
d901b1d3e3 Allow services to ignore user throttling. 2015-03-18 13:48:32 +00:00
Ned Batchelder
7d799e34f3 Remove unused imports 2015-03-17 07:10:31 -04:00
Andy Armstrong
6976a33a85 Add the preferences endpoint to the User API
TNL-1493

See https://openedx.atlassian.net/wiki/display/TNL/User+API for details
2015-03-16 23:34:35 -04:00
Awais
4bab316bb9 ECOM-911 no-id-professional mode registration flow 2015-03-13 10:03:05 +00:00
Will Daly
cbdc269b47 Cross-domain CSRF cookies
When configured, set an additional cookie with the CSRF
token for use by subdomains.

The cookie can have a different name than the default
CSRF cookie, preventing conflicts between cookies
from different domains (e.g. ".edx.org", "courses.edx.org",
and "edge.edx.org").

The new cookie is included only on the enrollment API
views so that the scope of this change is limited
to the end-points that require cross-domain POST requests.
2015-03-09 12:32:49 -04:00
Will Daly
7bad603978 Merge pull request #7076 from edx/will/deprecate-embargo
Deprecate old embargo implementation.
2015-03-03 15:54:41 -05:00
Diana Huang
1e4f1b5889 Allow the enrollment API to be accessed via API keys.
XCOM-107
2015-03-02 16:07:27 -05:00
Diana Huang
3b0bb11218 Add SKU to Course Modes
XCOM-94
2015-02-27 10:04:36 -05:00
Nimisha Asthagiri
b280e44fe1 Merge pull request #7025 from edx/mobile/oauth2-allow-inactive-user
MA-291 Allow API access without email activation.
2015-02-24 09:12:30 -05:00
Nimisha Asthagiri
83a3adb97b MA-291 Allow API access without email activation 2015-02-24 06:05:18 -05:00
Will Daly
ae8ddc8aee Deprecate old embargo implementation.
The new "country access" implementation replaces the old
implementation.  Middleware and tests have been updated
accordingly, but deprecated models are preserved
for backwards compatibility.
2015-02-23 15:48:04 -05:00
Akiva Leffert
003a9453ac Convert enrollment already exists errors to success.
JIRA: https://openedx.atlassian.net/browse/MA-290
2015-02-20 19:31:21 -05:00
Akiva Leffert
388139778d Add optional email_opt_in parameter to enrollment end point.
JIRA: MA-286
2015-02-12 10:40:27 -05:00
Will Daly
e609f982d7 Country Access: block enrollment
Block users from enrolling in a course if the user
is blocked by country access rules.

1) Enrollment via the login/registration page.
2) Enrollment from the marketing iframe (via student.views.change_enrollment)
3) Enrollment using 100% redeem codes.
4) Enrollment via upgrade.

This does NOT cover enrollment through third party authentication,
which is sufficiently complex to deserve its own commit.
2015-02-10 13:07:51 -05:00
Calen Pennington
b353ed2ea2 Better support specifying of modulestore configuration in test cases
The existing pattern of using `override_settings(MODULESTORE=...)` prevented
us from having more than one layer of subclassing in modulestore tests.

In a structure like:

    @override_settings(MODULESTORE=store_a)
    class BaseTestCase(ModuleStoreTestCase):
        def setUp(self):
            # use store

    @override_settings(MODULESTORE=store_b)
    class ChildTestCase(BaseTestCase):
        def setUp(self):
            # use store

In this case, the store actions performed in `BaseTestCase` on behalf of
`ChildTestCase` would still use `store_a`, even though the `ChildTestCase`
had specified to use `store_b`. This is because the `override_settings`
decorator would be the innermost wrapper around the `BaseTestCase.setUp` method,
no matter what `ChildTestCase` does.

To remedy this, we move the call to `override_settings` into the
`ModuleStoreTestCase.setUp` method, and use a cleanup to remove the override.
Subclasses can just defined the `MODULESTORE` class attribute to specify which
modulestore to use _for the entire `setUp` chain_.

[PLAT-419]
2015-02-04 09:09:14 -05:00
Awais
f3bf66c1c0 ECOM-763 handling InvalidKeyError exception. 2015-01-30 11:41:30 +05:00
Will Daly
305f0c3338 Can disable rate limiting for enrollment API end-points using model-based configuration. 2015-01-26 15:28:04 -05:00
Stephen Sanchez
6616b7b5c9 Merge pull request #6731 from edx/sanchez/cache_course_enrollment_details
Adding caching to the course details endpoint for the Enrollment API.
2015-01-23 08:55:02 -05:00
stephensanchez
896bc1c859 Adding caching to the course details endpoint for the Enrollment API. 2015-01-22 20:58:22 +00:00
stephensanchez
2d1d58225a Allow the enrollment API to be used without knowing the authenticted user name. 2015-01-22 19:50:02 +00:00