Commit Graph

34 Commits

Author SHA1 Message Date
M. Zulqarnain
f4a5af29d3 pyupgrade in program_enrollments (#26597) 2021-02-22 12:58:16 +05:00
Awais Qureshi
ea26268b0a BOM-2285
Apply pylint-amnesty.
2021-02-02 12:09:42 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Simon Chen
681eea44f7 MST-418 retire program_enrollments external_user_key with hashed values instead of setting it to null (#25001) 2020-09-16 21:40:00 -04:00
Michael Roytman
38c255dbd2 Enhance the Link Program Enrollments Support Tool to handle the case of linking a learner to a ProgramEnrollment that is already linked to a different edX account.
In this case,
* unenroll the currently linked learner from the courses associated with related ProgramCourseEnrollments
* for each course the is enrolled in as part of a ProgramCourseEnrollment, if the coures has an audit track, then move the enrollment into the audit track. Otherwise, keep the learner's enrollment in the existing track.
* link the new user to the ProgramEnrollment
* enroll the new user in the Master's track in the courses associated with related ProgramCourseEnrollments
2020-05-06 10:15:42 -04:00
Zachary Hancock
b9bafed817 add pending role assignment model (#23506) 2020-03-27 14:29:09 -04:00
Kyle McCormick
f4d5bc22f9 Improve repr() output of program_enrollments models 2020-03-18 14:33:36 -04:00
Awais Qureshi
0f002bafb8 BOM-1399
checking django-wiki and fixing deprecation warnings.
2020-03-16 14:37:18 +05:00
Simon Chen
eb3e36b822 MST-121 We should allow the business case where a learner can be enrolled into a program, then unenrolled, then enroll into another program with the same course 2020-03-03 14:39:57 -05:00
Aarif
e607657a73 Merge pull request #22620 from edx/on_delete_parameter
Added on_delete parameter to models
2019-12-31 15:23:47 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
aarif
02350e0fee added on_delete parameter to foreign_key and oneToOne fields
changes made to fix issues with quality
2019-12-27 19:59:45 +05:00
Kyle McCormick
da08357d89 Revert "Revert "Create Python API for program_enrollments: Part IV"" (#21759)
This reverts commit a67b9f70a16a0f16a842aad84754b245a2480b5f,
reinstating commit cf78660ed35712f9bb7c112f70411179070d7382.
The original commit was reverted because I thought I found
bugs in it while verifying it on Stage, but it turns out that
it was simply misconfigured Stage data that causing errors.

The original commit's message has has been copied below:

This commit completes the program_enrollments LMS app
Python API for the time being. It does the following:
* Add bulk-lookup of users by external key in api/reading.py
* Add bulk-writing of program enrollments in api/writing.py
* Move grade-reading to api/grades.py
* Refactor api/linking.py to use api/writing.py
* Refactor signals.py to use api/linking.py
* Update rest_api/v1/views.py to utilize all these changes
* Update linking management command and support tool to use API
* Remove outdated tests from test_models.py
* Misc. cleanup

EDUCATOR-4321
2019-09-24 10:49:54 -04:00
Kyle McCormick
775d2fd807 Revert "Create Python API for program_enrollments: Part IV"
This reverts commit af4e7a348a.

After merging the above commit, I was seeing 'internal-error's
on Stage in responses to the Registrar API. I am temporarily
reverting it until I can figure out a fix.
2019-09-23 09:39:01 -04:00
Kyle McCormick
af4e7a348a Create Python API for program_enrollments: Part IV
This commit completes the program_enrollments LMS app
Python API for the time being. It does the following:
* Add bulk-lookup of users by external key in api/reading.py
* Add bulk-writing of program enrollments in api/writing.py
* Move grade-reading to api/grades.py
* Refactor api/linking.py to use api/writing.py
* Refactor signals.py to use api/linking.py
* Update rest_api/v1/views.py to utilize all these changes
* Update linking management command and support tool to use API
* Remove outdated tests from test_models.py
* Misc. cleanup

EDUCATOR-4321
2019-09-20 09:55:13 -04:00
Kyle McCormick
358f989131 Create Python API for program_enrollments: Part III
This is the third in a series of commits to create
a Python API for the LMS program_enrollments app.
It does the following:
* Creates api/ folder.
* Moves link_program_enrollments.py to api/linking.py
* Creates api/reading.py for enrollment-fetching
  functions.
* Updates rest of app to use api/reading.py when
  it was going directly through the models before.
* Other misc. cleanup (isorting, unicode_literals,
  line breaks, etc).

Still to do:
* Create api/writing.py and update app to use it instead
  of going directly through models.
* Create api/reset.py and api/expire.py, which the management
  commands call out to.

EDUCATOR-4321
2019-09-12 14:54:03 -04:00
Kyle McCormick
ea5652010c Create Python API for program_enrollments: Part I (#21511)
This is the first in a series of commits to create
a Python API for the LMS program_enrollments app.
We do some general refactoring, renaming, and clean-up
in order to move toward the creation of that API.

EDUCATOR-4321
2019-09-04 14:06:00 -04:00
Zachary Hancock
1a03816ddc ignore enrollment checks for masters (#21517) 2019-09-03 16:45:02 -04:00
Kyle McCormick
2c572e1b59 Add new ProgramCourseEnrollment uniqueness constriant (#21463)
ProgramCourseEnrollments were already unique on
(program_enrollment, course_enrollment) by nature of the
OneToOneField on course_enrollment. However, this only
affects realized enrollments. For waiting enrollments, we
need to add a uniqueness constraint on
(program_enrollment, course_key).
2019-08-27 15:05:30 -04:00
Alex Dusenbery
ce943bced2 Add the correct UNIQUE constraints to the ProgramEnrollment model. 2019-08-23 14:02:54 -04:00
jansenk
4c93bcbf8f Add put endpoint for program enrollments, rework program enrollment view 2019-07-01 09:33:30 -04:00
amitvadhel
fb4aa2a407 INCR-474: Run python-modernize and isort 2019-06-21 14:00:24 +03:00
Kyle McCormick
c487b9a384 Change 'withdrawn' status to 'canceled' in program_enrollments
This makes the LMS program_enrollments API compatible with the
Registrar programs API, as specified in the Master's partner
integration guide.

EDUCATOR-4389
2019-06-03 10:16:19 -04:00
Zach Hancock
a350d327de complete waiting enrollments. fixed 2019-05-24 13:47:49 -04:00
Simon Chen
0b08867aee Revert "complete waiting enrollments"
This reverts commit b041a1f3e6.
2019-05-15 21:20:45 -04:00
Zach Hancock
b041a1f3e6 complete waiting enrollments 2019-05-10 09:55:24 -04:00
jansenk
1caa647621 add program course enrollment PATCH 2019-05-07 15:52:03 -04:00
Rick Reilly
350b4a2589 Add POST method for program enrollments 2019-05-03 14:14:04 -04:00
jansenk
6052a4e4c6 add program course enrollment post endpoint 2019-05-02 17:42:18 -04:00
Alex Dusenbery
20f0bc03d4 Add a GET API endpoint for program enrollments. 2019-05-01 11:35:38 -04:00
Alex Dusenbery
4d6458284c Fix the program_enrollments admin classes. 2019-04-25 13:06:06 -04:00
Alex Dusenbery
bf661eaa8d Add unique constraint to ProgramEnrollment model 2019-04-24 13:47:23 -04:00
jansenk
0622c69d75 add ProgramCourseEnrollment 2019-04-19 12:56:50 -04:00
Rick Reilly
2bf3e6621e Add ProgramEnrollment app and model for masters 2019-04-12 15:50:30 -04:00