Commit Graph

11 Commits

Author SHA1 Message Date
David Ormsbee
3ce87583ab Shift enroll/unenroll logic to CourseEnrollment model, add is_active and mode.
Features coming down the pipe will want to be able to:
* Refer to enrollments before they are actually activated (approval step).
* See what courses a user used to be enrolled in for when they re-enroll in
  the same course, or a different run of that course.
* Have different "modes" of enrolling in a course, representing things like
  honor certificate enrollment, auditing (no certs), etc.

This change adds an is_active flag and mode (with default being "honor").
The commit is only as large as it is because many parts of the codebase were
manipulating enrollments by adding and removing CourseEnrollment objects
directly. It was necessary to create classmethods on CourseEnrollment to
encapsulate this functionality and then port everything over to using them.

The migration to add columns has been tested on a prod replica, and seems to be
fine for running on a live system with single digit millions of rows of
enrollments.
2013-08-14 13:23:06 -04:00
Miles Steele
7fe9f70ab3 fix test mocking 2013-08-08 13:16:49 -04:00
Miles Steele
fb8c84a516 add analytics proxy endpoint 2013-08-08 13:16:47 -04:00
David Baumgold
714d3b9662 pylint fixes 2013-08-06 14:36:13 -04:00
David Baumgold
ef4220ee43 Add unit tests to exercise common_exceptions_400 decorator 2013-08-05 16:54:56 -04:00
Miles Steele
4b671d1195 fix pylint violations 2013-08-02 09:53:21 -04:00
Miles Steele
b44e8fe8b8 add regrade & rescore & task api tests, clean api 2013-08-02 09:53:20 -04:00
Miles Steele
7905e7d289 add csv & enrollment & access api tests, disallow instructors from un-instructoring themselves, rename mode to action for access 2013-08-02 09:53:20 -04:00
Miles Steele
7392a888ce cleanup, fix permissions, rename functions, add more api tests 2013-08-02 09:53:20 -04:00
Miles Steele
cc9371d14e fix formatting, address comments from PR #322 2013-08-02 09:52:18 -04:00
Miles Steele
94ac02e8b4 refactor enrollment action reporting 2013-08-02 09:52:17 -04:00