Commit Graph

813 Commits

Author SHA1 Message Date
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
Tim McCormack
c0bed87954 Revert "ENT-4361 | Added user's "id" and "email" as public fields in ACCOUNT_VISIBILITY_CONFIGURATION." (#27942) 2021-06-11 22:53:41 +00:00
Azan Bin Zahid
0f1ea9b254 Merge pull request #27639 from edx/azan/PROD-2333
feat: add activation_key in accounts view
2021-05-18 21:18:04 +05:00
Azan Bin Zahid
d9abf98056 feat: add activation_key in accounts view 2021-05-18 20:09:00 +05:00
Eric Herrera
353153666d refactor!: Enable Account MFE globally.
This commit refactors the way the Account MFE is activated in the
platform. The main objective is to control the global
activation/deactivation of the MFE through the
account.redirect_to_microfrontend waffle flag and use the Site
Configurations to control MFE activation/deactivation with per-site
granularity. Notice that the Site Configuration object will have
precedence over the waffle flag value.

Since the classic Account Django view will be most likely supported
during Lilac, the expiration of this temporary waffle flag was
extended till the end of 2021

With this commit:

- There's no need to create a Site Configuration object to get the MFE
activated. Setting the waffle flag to True is enough.
- It helps multisite installations to better handling granular
per-site activation/deactivation.

BREAKING CHANGE:

For operators of multisite installations, the activation of the waffle
flag will now activate the MFE for all sites, unless explicitly
disabled on a per-site basis.

Otherwise, this is a backwards-compatible change, since the MFE will
remain activated for installations where this is already enabled.
2021-05-13 11:47:34 -05:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Usama Sadiq
63a9327a9d refactor: pyupgrade second iteration (#27460) 2021-05-10 13:57:24 +05:00
Zainab Amir
8d4ccf950a Update validation messages for register endpoint (#27476)
As part of authn redesign, validation messages have been updated.
- created a new endpoint for validations
- updated username/email conflict message in registration api based on
authn check

VAN-288
2021-05-05 12:33:59 +05:00
Hammad Ahmad Waqas
7a3b53afec Merge pull request #27430 from edx/hammad/ENT-4483
Updated account view to accept application/json for the post request.
2021-04-27 17:37:48 +05:00
HammadAhmadWaqas
149e448e5b Updated account view to accept application/json for the post request. 2021-04-27 16:47:57 +05:00
Usama Sadiq
588f11b100 refactor: apply lint-amnesty to pylint violations 2021-04-27 14:43:31 +05:00
Hammad Ahmad Waqas
c097cfc23e Merge pull request #27382 from edx/hammad/ENT-4483
ENT-4483 | added search_emails endpoint in accounts.
2021-04-21 20:16:57 +05:00
HammadAhmadWaqas
7489f14baf added search_emails endpoin in accounts. 2021-04-21 13:59:53 +05:00
Zaman Afzal
0d7245d346 Removed the waffle switch ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER (#27379) 2021-04-21 13:14:15 +05:00
Usama Sadiq
2b55959a8e refactor: apply lint-amnesty on existing violations 2021-04-20 23:51:31 +05:00
Hammad Ahmad Waqas
d904534fc8 Merge pull request #27239 from edx/hammad/ENT-4361
ENT-4361 | Added user's "id" and "email" as public fields in ACCOUNT_VISIBILITY_CONFIGURATION.
2021-04-13 17:21:43 +05:00
HammadAhmadWaqas
3aa9248dcf * Added user's "id" and "email" as public fields in ACCOUNT_VISIBILITY_CONFIGURATION.
* Updated api/user/v1/accounts list view to search based on multiple emails as well.
2021-04-12 21:13:53 +05:00
Jawayria
e3a449d63e Merge pull request #26604 from edx/jawayria/bom-2408-6
BOM_2408: Removed unused imports from openedx/core/djangoapps/user_api
2021-04-12 14:46:14 +05:00
Pooja Kulkarni
86bfcea19c feat: Django app to allow user retirement via API (#25800)
This adds a new django app to allow the GDPR user retirement via
Open edX's REST API. Prior to this the only way to trigger the user
retirement was either by the user themself clicking "Delete my account"
in the account setting page or via creating a User Retirement request
by admin. With these changes, the user retirement process can be
triggered using REST API.
2021-04-08 13:50:12 -04:00
Zaman Afzal
194f29ca55 ENT4134 Add the support for multiple IDPs (#27073)
* ENT4134 Add the support for multiple IDPs
2021-04-06 23:27:20 +05:00
Jawayria
83aa5f02f1 Refactor: Removed unused imports
Removed unused imports from openedx/core/djangoapps/user_api
2021-04-06 18:25:35 +05:00
Usama Sadiq
91ea53da56 refactor: Ran pyupgrade on openedx/core/djangoapps/user_api 2021-04-06 12:50:48 +05:00
Feanil Patel
9f4a8e6724 Merge pull request #27233 from edx/feanil/flag_management
feat!: Replace logging WaffleSwitch with a django settinge.
2021-04-02 15:12:11 -04:00