Commit Graph

22 Commits

Author SHA1 Message Date
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
Mark Hoeber
a28fd30b09 Enrollment API Doc 2015-01-12 11:15:32 -05:00
stephensanchez
22a18e350d Updating the design of the DRF views for enrollments.
Consolidate PUT and POST on the RESTful Layer.

Change URLs for API

Test cleanup.

Adding a course details URL to the enrollment API.

Change student to user

Change to v1, remove feature flag from API URLs

Updating student to user in tests

Re-ordering redirect urls to be evaluated last.

Adding pagination and testing.

Adding Django REST settings for pagination.

Revert "Re-ordering redirect urls to be evaluated last."

This reverts commit 4c9502daa383e49b46f8abec5456c271e5e24ccb.

Re-ordering redirect urls to be evaluated last.

Conflicts:
	common/djangoapps/enrollment/urls.py

Revert "Adding Django REST settings for pagination."

This reverts commit 9f8a54c41f34caa24818c88f1e75ac59f6ce5259.

Conflicts:
	common/djangoapps/enrollment/urls.py

Revert "Adding pagination and testing."

This reverts commit 0b2d46262abb78f5ad170700205e7fd28b6af942.

Additional testing, logging, and error messages.
2014-12-18 15:39:01 +00:00
stephensanchez
7c78a0999a Code review comments 2014-12-04 16:16:32 +00:00
Sarina Canelake
e0f1d3f3f3 s/pylint: disable=C0111/pylint: disable=missing-docstring/ 2014-12-01 11:22:09 -05:00
stephensanchez
7d36d11b35 Remove enrollment updates from the Enrollment API. 2014-11-20 09:36:30 -05:00
stephensanchez
75e45bc2ee Update the API and Data Layer to get the student from the models. 2014-11-17 15:09:33 +00:00
Will Daly
92d10ebd17 Respond to code review feedback 2014-11-17 08:58:56 -05:00
Renzo Lucioni
8d02efb021 Clean up pep8 and pylint violations
Also fixes failing Python unit tests
2014-11-12 12:55:56 -05:00
Will Daly
b8f5be2cdd Allow inactive users to modify their own enrollments 2014-11-10 08:10:47 -05:00
Will Daly
578c04f62f Put logistration page behind a feature flag 2014-11-07 13:05:17 -05:00
Will Daly
e629ce2ba6 Move redirection/enrollment to AccessView and trigger it using an event.
Ensure window.isExternal is loaded

Don't set a default for terms of service

For paid courses, add the course to the cart and redirect to the shopping cart view.

Don't send form method and url as form data.

Stub window.analytics in the access view test.
2014-11-07 12:59:08 -05:00
Diana Huang
fc468bf696 Set up basic enrollment infrastructure. 2014-10-30 17:15:26 -04:00
stephensanchez
e7570c52e6 adding all the tests for data and api.
Updating tests for views

Last chunk of tests and pep8 cleanup

Code Review cleanup.

Additional CR comments

Changing serialization of suggested prices.
2014-10-23 16:57:29 +00:00
stephensanchez
f01e5268b4 Initial setup for new enrollment API
Quick tweaks to the API

Aggregating course modes data.

Fixing the POST request endpoints.
2014-10-20 20:26:31 +00:00