Commit Graph

24 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
Ned Batchelder
e045860cb6 Pylint complains if you use string, even if you use it for what its still meant to be used for. 2013-06-21 16:35:47 -04:00
Chris Dodge
fbbae44988 Merge branch 'master' of github.com:edx/edx-platform into feature/cdodge/autoprovision-forums-master
Conflicts:
	cms/djangoapps/contentstore/views/course.py
	lms/djangoapps/django_comment_client/base/views.py
	lms/djangoapps/django_comment_client/management/commands/show_permissions.py
	lms/djangoapps/django_comment_client/models.py
	lms/djangoapps/django_comment_client/tests/test_utils.py
	lms/envs/common.py
2013-05-20 10:22:36 -04:00
Jay Zoldak
71626f4ff6 Pep8 fixes of django_comment_client code 2013-05-16 15:57:34 -04:00
Chris Dodge
a92910db20 update lms to reflect where comment models.py is now in common 2013-05-06 16:23:32 -04:00
Brian Wilson
99778b1b5b add fixes for 500 bugs (lighthouse 287 and 293) by requiring login for accessing licenses and inline discussions. Add unit tests for licenses, and rearrange tests based off of (the former) PageLoad. Also cleanups for pylint and pep8. 2013-03-27 17:59:56 -04:00
Calen Pennington
cec3475c9d Remove references to .definition and .metadata in modules 2013-03-06 18:07:56 -05:00
Ned Batchelder
aa2d0ecaf2 We no longer need override_settings, Django has a better one. 2013-02-11 17:06:35 -05:00
David Ormsbee
119b4206a4 Revert "Fix permissions bug and add test cases for django comment client permissions."
This reverts commit e745087455.
2013-02-05 18:42:01 -05:00
Jay Zoldak
e745087455 Fix permissions bug and add test cases for django comment client permissions. 2013-01-29 14:30:15 -05:00
Victor Shnayder
00dd3ad9f8 Fix some of the test bugs. Still more to fix. 2013-01-25 15:40:13 -05:00
Kevin Chugh
07c1999a95 prep for staging 2013-01-24 21:43:36 -05:00
Victor Shnayder
771a55a631 turn forums on in test.py
- this may not be a good idea, but needed for testing cohorts for now...
2013-01-24 18:35:34 -05:00
Victor Shnayder
d17aedf3b4 the reverse isn't working for some reason... need to figure it out 2013-01-24 18:08:51 -05:00
Victor Shnayder
0b7e7b35dc stub out django comment client test system 2013-01-24 17:33:40 -05:00
David Ormsbee
d1aa0a254e Use one of our test courses when testing course permissions for the discussion client, because we now have course policy level overrides. 2012-11-02 17:21:00 -04:00
Rocky Duan
fd0eff46e7 Merge branch 'feature/rocky/discussion_api_key' into refactor
Conflicts:
	lms/djangoapps/django_comment_client/tests.py
	lms/lib/comment_client/utils.py
	lms/templates/courseware/courseware.html
2012-08-21 17:14:25 -07:00
David Ormsbee
1c84f8e2dd Remove student removal (we shouldn't ever delete users) 2012-08-21 13:00:06 -04:00
David Ormsbee
6d371640d4 Removed signal removal in django_comment_client test (we're no longer doing user replication) 2012-08-21 12:04:24 -04:00
Rocky Duan
0b3e9909a4 Merge branch 'master' into refactor
Conflicts:
	lms/djangoapps/django_comment_client/tests.py
	lms/static/coffee/src/discussion/content.coffee
	requirements.txt
2012-08-20 15:35:31 -07:00
Rocky Duan
dc599c469f fixed test 2012-08-20 15:26:07 -07:00
Rocky Duan
71df263ff9 disable all course db related signals 2012-08-20 11:57:58 -07:00
Rocky Duan
1f50da8814 fixed discussion permission test 2012-08-20 11:41:36 -07:00
Mike Chen
3f1534eab7 added permission framework. 2012-08-06 12:58:20 -04:00