Commit Graph

46 Commits

Author SHA1 Message Date
Usama Sadiq
afc0a6b770 refactor: Ran pyupgrade on openedx/core/djangoapps/enrollments (#26912)
Co-authored-by: Muhammad Soban Javed <58461728+iamsobanjaved@users.noreply.github.com>

Co-authored-by: Muhammad Soban Javed <58461728+iamsobanjaved@users.noreply.github.com>
2021-03-18 18:38:20 +05:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.

We should not be applying lint amnesty for such a violation.
2021-03-05 08:11:58 -05:00
Michael Roytman
eb98d7fac5 MST-675: QuerySet Performance for StudentOnboardingStatusByCourse Endpoint (#26789)
* The original use of user.has_perm('can_take_proctored_exam') in the get_active_enrollments_for_course method had very poor performance when used for multiple learners. The permission is not designed for use in bulk operations. It was being called for each user in a loop by edx-proctoring, resulting in many queries to the database. This lead to timeouts on the client. This change exposes a new service endpoint that performs this permission checking in the database, resulting in one single query to the necessary LMS SQL tables and many fewer queries to the modulestore.

* bump version of edx-proctoring to 3.7.3
2021-03-02 19:46:58 -05:00
Aarif
c880a44947 replaced unittest assertions pytest assertions (#26566) 2021-02-22 12:24:07 +05:00
Bianca Severino
54505b82c4 Merge pull request #26436 from edx/bseverino/proctoring-check-fix
[MST-645] Account for no enrollment in courseware rules
2021-02-08 13:39:40 -05:00
Bianca Severino
4fb36709a5 Account for no enrollment in courseware rules 2021-02-08 13:12:52 -05:00
Bianca Severino
e5cc220d96 Merge pull request #26357 from edx/bseverino/proctored-exam-email
[MST-636] Add additional check for proctoring requirements
2021-02-04 09:09:12 -05:00
M. Zulqarnain
39b207007c BOM-2323 : Pylint amnesty in embargo and enrollments apps (#26368)
* pylint amnesty in openedx apps
2021-02-04 15:32:59 +05:00
Bianca Severino
3f5cbcfc6a Check for an existing proctored exam before sending proctoring requirements email 2021-02-03 15:54:52 -05:00
Bianca Severino
902ab02357 Send proctoring requirements email when enrolled in relevant course mode 2021-02-01 09:44:30 -05:00
jawad khan
cb6f348959 LEARNER-8194
LEARNER-8194
Added self paced in mobile api enrolment api
2021-01-28 13:49:05 +05:00
jawad khan
091b2bc1fa LEARNER-8097
LEARNER-8097
Added self paced in course serializer
2021-01-22 13:18:35 +05:00
Zach Hancock
3a738e6c02 Create runtime api to return active enrollments by course
Co-authored-by: Bianca Severino <biancasev@gmail.com>
2021-01-13 16:45:40 -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
sarina
f414fad0cc Change gendered language to gender-neutral 'they/them/their' 2020-11-02 18:23:13 -05:00
Matt Tuchfarber
cbeab67833 Use demographics api for dashboard banner
Make demographics collection banner on dashboard use new demographics
API which checks enterprise as well. Also expose serialization of
CourseEnrollments.
2020-07-17 13:20:42 -04:00
stvn
0ae91c0921 Replace references to 'log.warn' with 'log.warning'
to remove some `DeprecationWarning`s from the logs
as the former method as been deprecated since Python 3.3 [1][2].

- [1] https://github.com/python/cpython/blob/3.3/Lib/logging/__init__.py#L1252-L1253
- [2] https://stackoverflow.com/a/15655674
2020-06-18 12:08:15 -07:00
Hasnain Naveed
332a8329dc Merge pull request #23595 from edx/hasnain-naveed/ENT-2675
ENT-2675 | Added permission for staff user to change the student's en…
2020-04-07 12:46:08 +05: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
hasnain.naveed
4fc1bbaa17 ENT-2675 | Added permission for staff user to change the student's enrollment. 2020-04-03 15:49:18 +05:00
Nimisha Asthagiri
b96d975b97 Django2 enrollments app: course_id str 2020-03-31 14:28:17 -04:00
Awais Jibran
e3069877af 383k instance / 7 days. 2020-03-17 16:59:19 +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
zia.fazal@arbisoft.com
18f73c744c Added ability to add enrollment with GlobalStaff permissions
added unit test

Reviewer feedback changes

Fixed broken test
2020-01-21 17:28:47 +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
Diana Huang
54be35f913 Move AccountCreationForm to user_authn. 2019-12-02 17:20:23 -05:00
Nimisha Asthagiri
4914c42364 Python 3: resp.content regex searches 2019-09-30 08:51:02 -04:00
Ned Batchelder
b3845b2b96 Merge pull request #21581 from edx/nedbat/fix-courseware-warning
Finally import courseware properly everywhere to get rid of a warning
2019-09-26 14:25:27 -04:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Waheed Ahmed
68b5f98485 Save order date attribute and some refactoring.
Save order placement date attribute so that we don't need to call
ecommerce again. Also did some refactoring.
2019-09-26 17:46:14 +05:00
Feanil Patel
cbf35593ac BOM-618 Decode to utf-8 before loading as json in tests. 2019-09-19 11:15:11 -04:00
aarif
ae8126bf98 python 3 fixes 2019-09-13 16:50:20 +05:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Feanil Patel
68933ec089 Fix quality issues. 2019-08-19 11:51:30 -04:00
David Ormsbee
9a1385585f Convert response bytes to str before JSON parsing. (#21375)
Convert response bytes to str before JSON parsing.
2019-08-19 11:01:55 -04:00
Christie Rice
3d062aab62 REVMI-354 Add enroll_in_course permission (#21243)
* REVMI-354 Add enroll_in_course permission

* Fix test
2019-08-01 08:37:41 -04: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
Ned Batchelder
39c7a2db7c Revert "Use drf-yasg for Open API documentation" 2019-06-11 16:05:00 -04:00
Ned Batchelder
8774ff1f9b Use ref_name to disambiguate serializers that drf-yasg would otherwise assume are the same. 2019-06-10 15:27:39 -04:00
Nimisha Asthagiri
d3b79ae5f7 README for enrollments app 2019-05-28 15:28:15 -04:00
Nimisha Asthagiri
9127075bcf Fix Pylint for enrollments 2019-05-28 13:25:02 -04:00
Nimisha Asthagiri
6e214a85b0 Move common/djangoapps/enrollment to openedx/core/djangoapps/enrollments 2019-05-28 11:20:53 -04:00