Commit Graph

835 Commits

Author SHA1 Message Date
Bianca Severino
f177855e1b feat: add REST endpoint to confirm name changes 2022-03-01 16:22:31 -05:00
Bianca Severino
cc43b5e567 Merge pull request #29952 from openedx/bseverino/name-affirmation-plugin
[MST-1360] Only enable verified name feature if Name Affirmation is installed
2022-02-23 09:18:44 -05:00
Zainab Amir
bd08bc7bdc feat: add optional fields rest api (#29942) 2022-02-22 17:51:34 +05:00
Bianca Severino
76f9756f92 feat: only enable verified name feature if Name Affirmation is installed 2022-02-18 13:25:30 -05:00
Michael Terry
b905de757b test: more Old Mongo removal from tests
Convert more tests from MONGO_AMNESTY to SPLIT modulestores.

This is in preparation for just wholesale denying access to Old
Mongo, so I either converted tests to split or just deleted some
test variants that were Old Mongo specific. (e.g. ddt lines)
2022-02-11 14:50:30 -05:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Simon Chen
1f36b35bc4 fix: remove the data point on zoom since edx_zoom is deprecated (#29860)
Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
2022-02-02 13:53:06 -05:00
AliAkbar
2989341b7c fix: add integer check for lms_user_id 2022-01-11 11:30:35 +05:00
DawoudSheraz
f970ab4566 feat: add admin-only/self accessible verified name field in accounts api 2021-12-29 14:51:10 +05:00
AliAkbar
0141c2b866 fix: fix sec staff-lock email 2021-12-22 16:53:29 +05:00
Attiya Ishaque
51b67ad1df fix: Replace hardcoded 'edx' with platform name. (#29657) 2021-12-22 12:51:56 +05:00
michaelroytman
ea3dc9cad6 fix: Do Not Prevent Learner From Changing Name With Non-Verified Enrollment/Non-Passable Certificate
The _does_name_change_require_verification(user_profile, old_name, new_name) method of the accounts user_api determines whether a learner can change their name from old_name to new_name. Originally, it delegated solely to the NameChangeValidator class of the edx-name-affirmation API, which ran a set of checks against the name change. One of said checks was asserting that learners with one or more certificates could not change their name without completing IDV.

This pull request changes this behavior.

Learners may have certificates that are not in a passable status (e.g. "unverified"). We only want to require IDV for name changes for learners that have passing statuses. The existing code prevented learners from changing their name if they had any certificates at all, irrespective of the certificate status. This change only considers certificates in a passable status.

Additionally, learners may have certificates and also not be enrolled in any "verified" seats. For example, despite edX no longer offering "honor" seats, learners may have enrollments in "honor" modes, which grant certificates but are not considered "verified" enrollment modes. IDV requires that a learner be enrolled in a "verified" seat in order to complete IDV. Prior to this change, learners that were navigated to IDV to validate a name change were unable to complete IDV. This change introduce a check that a learner is in a "verified" mode in addition to using the NameChangeValidator. This prevents the account MFE from navigating an IDV-ineligible learner to IDV.

MST-1254: https://openedx.atlassian.net/browse/MST-1254
2021-12-16 14:26:07 -05:00
John Nagro
3873ff7de9 feat: avoid certain strings in the suffix appended to edX usernames (#29524)
ENT-2824
2021-12-13 15:32:51 -05:00
Ali Akbar
7fe43a3cbf Merge pull request #29519 from edx/aakbar/PROD-2590
feat: allow get account info on lms user id
2021-12-10 12:50:13 +05:00
AliAkbar
c07c5bc0dd feat: allow get account info on lms user id 2021-12-09 20:27:18 +05:00
Michael Terry
e2e37154ce fix: add a couple guards for anonymous users
This fixes a couple places (LastSeenCoursewareTimezone and
UserCourseTag) where we were saving an entry for a user, but not
making sure we ignored anonymous users.
2021-12-09 10:26:51 -05:00
Jawayria
e48031cd86 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:39:45 +05:00
edX requirements bot
bb20b17428 Python Requirements Update (#29516)
* chore: Updating Python Requirements

* fix: fix pylint issues

Co-authored-by: Mohammad Ahtasham ul Hassan <mohammad.ahtasham@arbisoft.com>
2021-12-08 14:13:27 +05:00
Shafqat Farhan
84cba23c0b feat: VAN-666 - Reject new password that is detected as vulnerable on password reset 2021-12-03 19:19:21 +05:00
Usama Sadiq
780a6f3c2d Revert "chore: install codejail from pypi (#29481)" (#29501)
This reverts commit 21551095ac.
2021-12-02 22:19:15 +05:00
Mohammad Ahtasham ul Hassan
21551095ac chore: install codejail from pypi (#29481)
* chore: install codejail from pypi

* chore: Updating Python Requirements

* chore: Updating Python Requirements

* fix: fixed failing tests

* fix: fixed pytest failures

* fix: fixed failing test bug

* Update mocks.py

Co-authored-by: edX requirements bot <testeng+edx-requirements-bot@edx.org>
2021-12-02 17:07:29 +05:00
Gábor Boros
230795fb07 feat: add optional-exposed extra field type to registration form
This defines optional extra fields that are not hidden under the toggle on the 
registration page.
2021-11-12 15:24:59 +01:00
Ned Batchelder
d9dd10dc97 style: code cleanups from Steven Burch (#29292)
* chore: update deprecated import from collections

* chore: remove outdated imports from markdown library

as it hasn't been supported since 2.0.3 and we're on 3.x.
This was deprecated at least as early as 2012!

* docs: add docstring and remove lint-amnesty to markdown plugin

* chore: remove deprecated etree import

* style: remove unnecessary-comprehension for sets

* style: resolve a number of amnestied pylint complaints

Co-authored-by: stvn <stvn@mit.edu>
2021-11-10 07:11:57 -08:00
michaelroytman
bb299c9521 feat: Remove Use of VERIFIED_NAME_FLAG Waffle Flag and is_verified_enabled Utility
The VERIFIED_NAME_FLAG, the VerifiedNameEnabledView, and the verified_name_enabled key removed from responses for both VerifiedNameView view and VerifiedNameHistoryView
were removed as part https://github.com/edx/edx-name-affirmation/pull/12. This was released in version 2.0.0 of the edx-name-affirmation PyPI package. Please see below for additional context for the removal, copied from the name-affirmation commit message.

The VERIFIED_NAME_FLAG was added as part https://github.com/edx/edx-name-affirmation/pull/12, [MST-801](https://openedx.atlassian.net/browse/MST-801) in order to control the release of the Verified Name project. It was used for a phased roll out by percentage of users.

The release reached a percentage of 50% before it was observed that, due to the way percentage roll out works in django-waffle, the code to create or update VerifiedName records was not working properly. The code was written such that any change to a SoftwareSecurePhotoVerification model instance sent a signal, which was received and handled by the Name Affirmation application. If the VERIFIED_NAME_FLAG was on for the requesting user, a Celery task was launched from the Name Affirmation application to perform the creation of or update to the appropriate VerifiedName model instances based on the verify_student application signal. However, we observed that when SoftwareSecurePhotoVerification records were moved into the "created" or "ready" status, a Celery task in Name Affirmation was created, but when SoftwareSecurePhotoVerification records were moved into the "submitted" status, the corresponding Celery task in Name Affirmation was not created. This caused VerifiedName records to stay in the "pending" state.

The django-waffle waffle flag used by the edx-toggle library implements percentage rollout by setting a cookie in a learner's browser session to assign them to the enabled or disabled group.
It turns out that the code that submits a SoftwareSecurePhotoVerification record, which moves it into the "submitted" state, happens as part of a Celery task in the verify_student application in the edx-platform. Therefore, we believe that because there is no request object in a Celery task, the edx-toggle code is defaulting to the case where there is no request object. In this case, the code checks whether the flag is enabled for everyone when determining whether the flag is enabled. Because of the percentage rollout (i.e. waffle flag not enabled for everyone), the Celery task in Name Affirmation is not created. This behavior was confirmed by logging added as part of https://github.com/edx/edx-name-affirmation/pull/62.

We have determined that we do not need the waffle flag, as we are comfortable that enabling the waffle flag for everyone will fix the issue and are comfortable releasing the feature to all users. For this reason, we are removing references to the flag.

[MST-1130](https://openedx.atlassian.net/browse/MST-1130)
2021-11-01 13:33:55 -04:00
Robert Raposa
b6a943c392 fix: errors with anonymous user (#29042)
There are several errors that appear in monitoring when calls
are made with an anonymous user. This resolves one (or more).
2021-10-28 10:05:48 -04:00
M. Zulqarnain
834dabb399 feat: New codemods on OpenedX 2 (#28777) 2021-10-28 16:45:53 +05:00
Waheed Ahmed
d5ab616ca8 feat: COPPA - remove primary/elementary option from education (#29147)
Remove `primary/elementary` option from education field if COPPA compliance
feature flag is enabled. Also, renamed the flag.

VAN-762
2021-10-28 14:12:53 +05:00
Braden MacDonald
6c85668099 feat: write split modulestore's course indexes to Django/MySQL
Split modulestore persists data in three MongoDB "collections": course_index (list of courses and the current version of each), structure (outline of the courses, and some XBlock fields), and definition (other XBlock fields). While "structure" and "definition" data can get very large, which is one of the reasons MongoDB was chosen for modulestore, the course index data is very small.

This commit starts writing course indexes (active_versions) to both MySQL and Mongo, but continues to read from MongoDB only.

By moving course index data to MySQL / a django model, we get these advantages:
* Full history of changes to the course index data is now preserved
* Includes a django admin view to inspect the list of courses and libraries
* It's much easier to "reset" a corrupted course to a known working state, by using the simple-history revert tools from the django admin.
* The remaining MongoDB collections (structure and definition) are essentially just used as key-value stores of large JSON data structures. This paves the way for future changes that allow migrating courses one at a time from MongoDB to S3, and thus eliminating any use of MongoDB by split modulestore, simplifying the stack.
2021-10-26 10:06:52 -07:00
Attiya Ishaque
38961e7798 fix: [VAN-747] Improvemessage for emails already registered. (#29088) 2021-10-22 18:16:34 +05:00
M. Zulqarnain
43008723be feat: New codemods on OpenedX 3 (#28778) 2021-10-22 13:55:51 +05:00
Attiya Ishaque
7e3985291d feat: [VAN-751] Put user's year of birth behind the feature flag (#29025) 2021-10-22 11:33:01 +05:00
Usama Sadiq
9ee8df0980 fix: Remove pylint constraint and fix warnings (#28646) 2021-10-20 23:00:13 +05:00
David Ormsbee
ae124bd554 Revert "feat: store split modulestore's course indexes in Django/MySQL"
This reverts commit 96e5ff8dce.
2021-10-07 15:07:42 -04:00
Braden MacDonald
96e5ff8dce feat: store split modulestore's course indexes in Django/MySQL
Split modulestore persists data in three MongoDB "collections": course_index (list of courses and the current version of each), structure (outline of the courses, and some XBlock fields), and definition (other XBlock fields). While "structure" and "definition" data can get very large, which is one of the reasons MongoDB was chosen for modulestore, the course index data is very small.

By moving course index data to MySQL / a django model, we get these advantages:
* Full history of changes to the course index data is now preserved
* Includes a django admin view to inspect the list of courses and libraries
* It's much easier to "reset" a corrupted course to a known working state, by using the simple-history revert tools from the django admin.
* The remaining MongoDB collections (structure and definition) are essentially just used as key-value stores of large JSON data structures. This paves the way for future changes that allow migrating courses one at a time from MongoDB to S3, and thus eliminating any use of MongoDB by split modulestore, simplifying the stack.
2021-10-07 10:59:47 -04:00
Muhammad Soban Javed
fc14dba632 Merge pull request #28968 from edx/iamsobanjaved/django32-user-api-bool-fix
refactor: use value for filtering indexed boolean field
2021-10-07 17:53:06 +05:00
Jawayria
7d50ce104a refactor: use value to filter indexed boolean field (#28970)
* refactor: use value to filter indexed boolean field

* Update views.py

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2021-10-07 17:52:45 +05:00
Soban Javed
a830b08f05 refactor: use value for filtering indexed boolean field 2021-10-07 16:06:58 +05:00
Bianca Severino
e9d22fc190 fix: prevent name change request if requested name is identical to the existing name 2021-10-06 10:01:23 -04:00
Zachary Hancock
ae0927713d fix: consistent error response on name change (#28866) 2021-10-04 16:32:34 -04:00
sarina
0c74d347f7 fix: abstract edX-specific strings 2021-09-19 14:01:20 -04:00
alangsto
9b204debf4 feat: check if profile name changes are valid for name affirmation. (#28697)
MST-970. If name affirmation is enabled, a user should only be allowed to make limited edits to their profile name before they are required to go through IDV. Right now, the allowable edits are limited to:

* add/delete/replace one character (including one space on either side)

Edits that are not allowed, and therefore require IDV include:

* changing 2 or more characters
* changing their name 3 or more times

This behavior will not be enabled until name affirmation is fully rolled out, so there should be no noticeable difference in account settings behavior at the time this is merged.
2021-09-15 09:53:30 -04:00
Bianca Severino
65905a01ec feat: update account API to allow pending name changes 2021-09-01 11:26:43 -04:00
Usama Sadiq
cde050618e build: Moved user and group management commands and unit tests to edx-django-utils
- Removed manage_user and manage_group commands and their unit tests from edx-platform and added then to edx-django-utils.
- Modified User.post_save signal to ensure the user profile is created when manage_user management command is run to create a user.
- Added edx-django-utils to INSTALLED_APPS for LMS and Studio.
- Moved generate_password from openedx.core.djangoapps.user_authn.utils to edx_django_utils.user along with its unit test.
2021-08-30 12:03:37 +05:00
Jawayria
514c781917 chore: removed constraint on django-countries 2021-08-02 17:35:49 +05:00
Bianca Severino
14c85d9465 feat: pass verified name flag into user api 2021-07-20 16:58:39 -04:00
Bianca Severino
430f1554b4 Revert "feat: pass verified name flag into account settings"
This reverts commit 85dc8c8d67.
2021-07-19 12:06:33 -04:00
Bianca Severino
85dc8c8d67 feat: pass verified name flag into account settings 2021-07-19 11:03:24 -04:00
Awais Qureshi
0433af537f Django3 has removed python_2_unicode_compatible.
Execute the codemodes on this file and removed all usage.
2021-07-15 00:26:09 +05:00
Zaman Afzal
843e9ba29b ENT4083: Removed ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE waffle switch (#28057) 2021-06-30 13:58:11 +05:00
Muhammad Ammar
7d0bf2b3e7 fix: add is_staff permission on endpoint (#27947) 2021-06-14 15:15:34 -04:00