Commit Graph

104 Commits

Author SHA1 Message Date
Manjinder Singh
cce8cdd661 Replacing OAuth2Auth (#23067)
- Removing deprecated auth classes
- Replacing OAuth2AuthenticationAllowInactiveUserDeprecated with OAuth2AuthenticationAllowInactiveUser
- the old class was a child class of a deprecated class that we are removing and replacing.
2020-02-11 10:38:13 -05:00
Manjinder Singh
cea795b02e Added new auth class (#23018)
* Added new auth class

- Created new class called OAuth2AuthenticationAllowInactiveUser, which replaces old class with same name
- Renames previous  OAuth2AuthenticationAllowInactiveUser to  OAuth2AuthenticationAllowInactiveUserDeprecated
- Replaced all imports of  OAuth2AuthenticationAllowInactiveUser to call deprecated class instead
- testing new class in discussion(added flag based on django setting)
2020-02-06 10:37:27 -05:00
Kyle McCormick
28c0433352 Reinstate "Remove CourseOverview.get_from_id[s]_if_exists (#22918)"
This reverts commit cdb0619846,
which itself reverted 3ca006214e.

The original commit (3ca006) was reverted because it was suspected
that it was causing unexpectedly-increased memcached usage and
500s in the Gradebook API. It is not clear whether that is actually
the case. We are optimistically reinstating 3ca006 and will monitor
production to see if there is an adverse effect.

MST-105
2020-01-27 11:17:06 -05:00
Kyle McCormick
cdb0619846 Revert "Remove CourseOverview.get_from_id[s]_if_exists (#22918)" (#22926)
This reverts commit 3ca006214e.
2020-01-23 13:52:11 -05:00
Kyle McCormick
3ca006214e Remove CourseOverview.get_from_id[s]_if_exists (#22918)
The functions `CourseOverview.get_from_id_if_exists`
and `CourseOverview.get_from_ids if exists` are bug-
prone, in that they do not go to the modulestore
when a CourseOverview is out-of-date or uncached.
The docstrings spell this out, but callers seem
not to understand the implications.

So, in this commit, we:
* Remove both functions
* Add `CourseOverview.get_from_ids` for almost-as-fast
  yet safer bulk-fetching of overviews
* Update call sites to use `course_exists` or `get_from_ids`
  in place of the old functions.
* Add tests for @verify_course_exists.
This PR should specifically fix an issue where
the program_enrollments API was breaking when the CourseOverview
version was bumped.

CR-1708
2020-01-23 09:41:55 -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
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
8a7159a324 Fix other pep8 violations. 2019-12-30 13:01:55 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -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
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -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
Simon Chen
682a450362 Fix the bug where we return many programs if the number of courses the staff user is enrolled in are many 2019-12-19 15:00:43 -05:00
Matt Hughes
1284b7ca19 Fix lint errors and address review comments 2019-11-19 15:06:03 -05:00
Matt Hughes
1185d3dd9c lint fixes 2019-11-19 15:06:03 -05:00
Matt Hughes
66b970c11d Count duplicates 2019-11-19 15:06:03 -05:00
Matt Hughes
ce28ccb497 fix for python 3 2019-11-19 15:06:03 -05:00
Matt Hughes
8299e0e727 Add test of multiple folks in the upload 2019-11-19 15:06:03 -05:00
Matt Hughes
9a6664cc05 Add unit tests for some corner cases 2019-11-19 15:06:03 -05:00
Matt Hughes
fe4a2d0c4f Moved to taking a file rather than long blob-of-text argument 2019-11-19 15:06:03 -05:00
Matt Hughes
474ce9bea6 Management command for rewriting social auth uids
This management command will help us support migrating an SSO provider
from one configured user identifier to another, which may be necessary
when previous choices of UID aren't as stable as needed.

JIRA:EDUCATOR-4701
2019-11-19 15:06:03 -05:00
Matt Hughes
cfbfe35904 Link program enrollments on social auth updates in add. to creation
See
lms/djangoapps/program_enrollments/docs/decisions/0002-matriculation-on-user_social_auth_change.rst
for more details

JIRA:EDUCATOR-4770
2019-10-29 16:19:48 -04:00
Matt Hughes
b14ce70053 Add program enrollment status option: ended
We'd like to add this status to help distinguish between learners
who've graduated from the program and learners who warranted some sort
of removal from the program.

JIRA:EDUCATOR-4702
2019-10-15 12:47:20 -04:00
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