Commit Graph

80 Commits

Author SHA1 Message Date
Chris Pappas
918b70f9a1 ENT-2294 | Removing wrapper api in program_enrollments app that edx-enterprise will no longer use (#21763) 2019-09-25 10:55:43 -04: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
Chris Pappas
4c9af183cb ENT-2294 | Moving utility functions in program enrollments to places … (#21752)
* ENT-2294 | Moving utility functions in program enrollments to places related to the data they manipulate

* updating a mock path

* minor test fix
2019-09-24 10:07:38 -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
14d650a522 Style fix: de-dent docstring in linking.py 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
Brittney Exline
90e5fa90b9 ENT-2230 Fix import errors by adding __init__.py file 2019-09-09 13:35:40 -06:00
Kyle McCormick
52be01a577 Document temporary program_enrollments API to edx-enterprise (#21605)
See https://github.com/edx/edx-platform/pull/21511#pullrequestreview-285556560
for more context.
2019-09-09 13:12:31 -04:00
Brittney Exline
d35218a820 ENT-2230 Upgrade edx-enterprise to 1.9.12 2019-09-09 08:52:01 -06:00
Jansen Kantor
4988999697 Jkantor/support (#21541)
* refactor link_program_enrollments into it's own file, add support page
2019-09-05 13:35:43 -04:00
Kyle McCormick
6da1d061ff Create Python API for program_enrollments: Part II (#21556)
This is the second in a series of commits to create
a Python API for the LMS program_enrollments app.
We rename and reorganize some functions and classes
in order to move towards the creation of that API.

EDUCATOR-4321
2019-09-05 13:01:32 -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
Jansen Kantor
9e97e5107e Jkantor/overview active (#21494)
* filter for active course enrollments
2019-08-28 13:16:09 -04:00
Kyle McCormick
a8e4461ef7 Return absolute URIs from program_enrollments API responses (#21474)
Issues were caused in Learner Portal from inconsistency
in whether URLs returned by API calls were absolute
or relative. This commit standardizes them to all be
absolute.
2019-08-28 12:57:46 -04:00
Zachary Hancock
b9a2646e4d log all social auth creation failures (#21470)
logging on social auth creation failures
2019-08-28 11:39:24 -04:00
Jansen Kantor
1febfa047c make link_program_enrollments atomic per user (#21439)
* make link_program_enrollments atomic per user
2019-08-27 16:26:26 -04:00
Kyle McCormick
708e08930f Fix program course enrollment overview docstring (#21472)
The program course enrollment overview endpoint says
it has a field 'course_status' with a possible value 'in-progress'.
Update it to say it has a field 'course_run_status with a
possible value 'in_progress'.
2019-08-27 16:23:06 -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
Awais Qureshi
544c68b1ff Merge pull request #21444 from edx/awais786/BOM-365
BOM-365
2019-08-27 14:47:49 +05:00
arbisoft
e1aca5b659 BOM-365
fixing python3 test.
2019-08-27 13:52:56 +05:00
Jansen Kantor
0ee01a3cac filter out disabled saml provider configs (#21454)
* filter for enabled saml provider configs
2019-08-26 12:29:38 -04:00
Alex Dusenbery
ce943bced2 Add the correct UNIQUE constraints to the ProgramEnrollment model. 2019-08-23 14:02:54 -04:00
Dave St.Germain
0267b5c85f Fix issue of out of order calls 2019-08-19 10:54:39 -04:00
Zachary Hancock
96f99bc053 reset integration environment endpoint (#21319) 2019-08-14 13:19:45 -04:00
Chris Pappas
4829fd4fde ENT-2117 | Creating new endpoint for enterprise learner portal. Includes small refactor of programs_enrollment GET logic, sowe do not need to duplicate the logic (#21258)
Adding new course_overview internal api

CourseOverview serializer work

Removing enterprise learner portal djangoapp from this repo

Removing ent learner portal url

Minor cleanups

Updating serializers again

typo

adding some tests and quality fixes

more quality fixes

Fixing test

Adding in an import i removed
2019-08-14 11:27:12 -04:00
Jansen Kantor
ecb65a4fff Jkantor/link program enrollments (#21330)
* add management command to link program enrollments to users
2019-08-13 13:37:11 -04:00
Kyle McCormick
fff69a9f58 Add course grade listing API for program_enrollments app
This new API endpoint differs from the existing Grades API
in that (i) it only includes grades for users enrolled with a
ProgramCourseEnrollment and (ii) it alters its return code
depending on whether any student's grade failed to load.

EDUCATOR-4529
2019-08-13 13:33:02 -04:00
aarif
61800c619f replaced StringIO imports with import from six
replaced cStringIO and StringIO imports with import from six

fixed StringIO imports

fixed StringIO imports

fixed XSS python-wrap warning
2019-08-08 00:09:16 +05:00
Simon Chen
1b9cba5cf1 EDUCATOR-4539 update program access so global staff and course staff related cases can be handled 2019-08-07 09:01:37 -04:00
Alex Dusenbery
8a2bf2b60e EDUCATOR-4543 | Let the program_enrollments overview endpoint return course enrollment information for verified and masters mode enrollments, even if they are not directly tied to a ProgramCourseEnrollment. 2019-08-06 16:49:44 -04:00
Alex Dusenbery
70e2aaa95b EDUCATOR-4543 | Add utility functions to the catalog module that picks out all of the course_runs associated with a program, even those that live inside the curriculum of a sub-program. Use these functions to populate the course -> program index of the catalog/programs cache. Also some refactoring of a program_enrollments overview endpoint. 2019-08-05 11:30:19 -04:00
uzairr
80316c632d Update Help msgs of management commands
PROD-399
2019-08-02 15:20:26 +05:00
Zachary Hancock
2f6b4c0a46 Management command to reset program enrollment data (#21221)
mgmt cmd to reset program enrollments data
2019-07-26 09:39:40 -04:00
jansenk
8e7b647a4f tests for extra columns 2019-07-10 11:16:25 -04:00
jansenk
4c93bcbf8f Add put endpoint for program enrollments, rework program enrollment view 2019-07-01 09:33:30 -04:00
Feanil Patel
729495e1aa Merge pull request #20871 from amitvadhel/INCR-475
Incr 475
2019-06-26 14:51:15 -04:00
Feanil Patel
615b9c7dae Merge pull request #20868 from amitvadhel/INCR-474
Incr 474
2019-06-26 14:17:09 -04:00
Simon Chen
d48ba26d50 Update LMS API to send correct response status code 2019-06-25 19:40:42 -04:00
Simon Chen
a86e8d4f19 EDUCATOR-4361 Add PUT api endpoint to the edx-plaform program course enrollment view 2019-06-25 15:12:22 -04:00
Ned Batchelder
aa13a634a6 Merge pull request #20821 from edx/nedbat/drf-yasg
Upgrade djangorestframework and install drf-yasg to get better OpenAPI support
2019-06-25 13:49:13 -04:00
amitvadhel
b6b1b0c602 INCR-473: Make compatible with Python 3.x 2019-06-23 13:29:43 +03:00
Ned Batchelder
b3a731550c Fix problems that drf-yasg uncovered.
These were originally fixed individually, but had to be reverted, and
are now combined in one commit.  The originals were:

7b9040f6b0 This enum was backwards
8774ff1f9b Use ref_name to disambiguate serializers that drf-yasg would otherwise assume are the same.
8a44397139 Is this field missing because it is None?
4a1154a7ca Give a safer buffer for clearing the rate limiting
64c47856dd DRF 3.7.4 changed how you delegate to another view, so don't
7359ca4fb2 Is this right? It fixes two tests
fdd66e5390 Adjust the expected error message for DRF 3.7.7
9257f68fd8 The default TIME_ZONE should be UTC
2019-06-21 18:04:15 -04:00
amitvadhel
fb4aa2a407 INCR-474: Run python-modernize and isort 2019-06-21 14:00:24 +03:00
amitvadhel
e304ab0c3f INCR-475: Make compatible with Python 3.x 2019-06-21 13:41:23 +03:00
Ned Batchelder
39c7a2db7c Revert "Use drf-yasg for Open API documentation" 2019-06-11 16:05:00 -04:00
Ned Batchelder
9257f68fd8 The default TIME_ZONE should be UTC
In production, we use UTC as the time zone.  DRF 3.7.7 now puts all
times in the currently set timezone where it used to use UTC.  By
setting TIME_ZONE to UTC, we keep the same results we used to get.

In a few places, we had to change the expected test results to be UTC.
2019-06-10 15:27:39 -04:00
jansenk
e5c3084e8c return 422 on bad input 2019-06-06 15:39:46 -04:00
jansenk
cf32f5bcf9 allow orgs w/o idp configured to enroll students in a program 2019-06-05 12:55:54 -04:00