Commit Graph

132 Commits

Author SHA1 Message Date
Aarif
27480cdd2f Removed deprecated future imports 2020-06-23 18:51:43 +05:00
Alex Wang
931f0ae5f5 add username and email to getProgramEnrollment response (#24186)
MST-234
2020-06-16 11:57:23 -04:00
Simon Chen
d0f99ec778 MST-264 Fix bug for course staff user in unrelated course (#24099)
* MST-264 Fix the wrong assumption that a course_staff of a course not related to programs should be in course_staff logic
2020-06-01 11:11:37 -04:00
Simon Chen
53d2e24258 Revert "Add logging statements to investigate MST-264"
This reverts commit 51ed4d93df6b795de1b5945a58e6a1f1c6972220.

The logging statement made clear the root cause of the bug.
2020-05-29 10:32:48 -04:00
Simon Chen
8b011d980c Add logging statements to investigate MST-264 2020-05-28 16:50:15 -04:00
Simon Chen
e7bfb7aed0 Add the ADR for the accepted decision to support the enrollment of a single user to the same course from multiple programs 2020-05-26 14:57:15 -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
Kyle McCormick
ec9ac34886 Paginate course card API for Programs Learner Portal
* Pull business logic of ProgramCourseEnrollmentOverviewView
  out of view class and into utils.py.
* Add UserProgramCourseEnrollmentsView, which is a paginated
  version of ProgramCourseEnrollmentOverviewView with a
  URL that is parameterized on the user (to enable masquerading
  in MST-109).
* Add get_certificates_for_user_by_course_keys to certs API
  to make enrollments overviews REST API use fewer SQL queries.
* Document new course cards API with edx-api-doc-tools.

In a follow-up ticket, the Programs Learner Portal will switch
to the new paginatd API in order to speed up its page load.

MST-126
2020-05-04 09:26:23 -04:00
Kyle McCormick
2983fb0af6 Speed up ProgramCourseEnrollmentOverviewGetTests with setUpClass 2020-05-04 09:26:23 -04:00
Kyle McCormick
a86576e69b Fix isort and pylint violations in program_enrollments
Run isort -rc lms/djangoapps/program_enrollments
Run pylint lms/djangoapps/program_enrollment and fix messages.

Stop pylint from complaining about DictFactoryBase instances
2020-05-04 09:26:23 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Zachary Hancock
f9bd748169 remove bulk write of CourseAccessRoleAssignment (#23849) 2020-04-30 11:05:15 -04:00
Zachary Hancock
cb44075ace only query due_dates for courses in progress (#23823) 2020-04-29 12:15:03 -04:00
Michael Roytman
316e76f7e9 realize CourseAccessRoles for a user when an LMS user is linked to their external_user_key 2020-04-17 18:16:58 -04:00
Simon Chen
fe1ef21bcd MST-187 return course staff role data for ProgramCourseEnrollment get API 2020-04-14 13:47:12 -04:00
Zachary Hancock
f0d7ff9025 Write course_staff role on enrollment (#23677) 2020-04-13 14:13:24 -04:00
Feanil Patel
7a52a25132 Fix tests that were creating Enrollments via a course_id.
We now either pass in the relevant courseoverview or when creating the
enrollement we use the factory which automatically creates the relevant
CourseOverview object for testing purposes.
2020-04-06 09:37:36 -04:00
Zachary Hancock
b9bafed817 add pending role assignment model (#23506) 2020-03-27 14:29:09 -04:00
Simon Chen
0b90de1d94 MST-157 PART-2 Complete the functionality of searching for user info on program enrollment. The search result will be displayed on support tool's frontend. 2020-03-19 20:50:47 -04:00
Kyle McCormick
b40b55cbbf Improve Django admin listings for program_enrollments 2020-03-18 14:33:36 -04:00
Kyle McCormick
f4d5bc22f9 Improve repr() output of program_enrollments models 2020-03-18 14:33:36 -04:00
Awais Jibran
1296b6a79d Merge pull request #23427 from edx/logs-cleanup
Remove/Limit log.info
2020-03-18 12:08:23 +05:00
Matt Hughes
acce8baca4 Add management command for retroactively adding sso IdV for IdP
We sometimes update preexisting SAML SSO providers to configure them
to automatically create SSO identity verification (IdV) records when a
learner links an account via that provider. Turning that configuration
from off to on does make it such that when learners log back in via
their linked account, a new IdV record will be created for them. But
it's possible we'd want this process to happen more automatically and
seamlessly, for which this management command will be helpful.

Note that this does not help with removing SSO verification records
for a provider for which this configuration has been turned off.

JIRA:EDUCATOR-4947
2020-03-17 16:04:24 -04:00
Awais Jibran
d47a0b61a9 301k in last 7 days. 2020-03-17 17:31:37 +05:00
Awais Qureshi
0f002bafb8 BOM-1399
checking django-wiki and fixing deprecation warnings.
2020-03-16 14:37:18 +05:00
Zachary Hancock
2325b3af7a history on bulk create of enrollments (#23389)
fixes bug where bulk creation of enrollments caused no new history records to be created
2020-03-13 12:55:58 -04: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
Manjinder Singh
d7bd80a100 Renamed OAuth2Authentication to BearerAuthentication (#23128)
* Renamed OAuth2Authentication to BearerAuthentication
* Added back OAuth2Authentication name
-there are libraries such as edx-enterprise that still import OAuth2Authentication.  The OAuth2Authentication class should be fully removed when everything is importing BearerAuthentication correctly
2020-02-18 13:29:29 -05:00
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