Commit Graph

854 Commits

Author SHA1 Message Date
John Nagro
efa979a13d temp: guard against resume button failures in dropdown template (#30703) 2022-07-06 13:05:14 -04:00
Attiya Ishaque
27a787aa5a fix: [VAN-975] add confirm email field to registration form (#30584) 2022-06-16 18:15:56 +05:00
Zaman Afzal
ec36d3a949 fix: revert Add Learner pathway progress update signal (#30598) 2022-06-16 01:59:40 +05:00
Zaman Afzal
6c6dabaa3c Feat: Add Learner pathway progress update signal (#30547)
* feat: Add Learner pathway progress update signal
2022-06-15 00:58:22 +05:00
Syed Sajjad Hussain Shah
142945c930 Merge pull request #30488 from openedx/sajjad/VAN-965
fix: Name field validation issue [VAN-965]

The name validation error was being removed after backend validation 

VAN-965
2022-06-03 12:04:11 +05:00
Syed Sajjad Hussain Shah
2fc04e65db fix: Name field validation issue from lms [VAN-965] 2022-05-25 14:56:38 +05:00
Eugene Dyudyunov
b4fecd620b refactor: rename toggle_warnings to toggle_warning (#30458)
Rename toggle_warnings to toggle_warning for consistency with setting_warning.
2022-05-24 11:47:31 -04:00
Attiya Ishaque
75ca47695c feat: add required fields rest api (#30198)
* feat: add required fields rest api

* feat: first review changes added.
2022-05-20 12:06:24 +05:00
Eugene Dyudyunov
289e682b8f FC-0001: Remove old EdxRestAPIClient usage across the platform (#30301)
* refactor: remove EdxRestAPIClient

* test: update tests according to EdxRestAPIClient removal

* fix: remove unused import
2022-05-09 12:48:26 -04:00
Eugene Dyudyunov
8bd43207ca refactor!: switch from LegacyWaffle* to modern waffles (#30330)
This is a first stage for removing the LegacyWaffle* classes.

LegacyWaffleFlag usage replaced with WaffleFlag;
LegacyWaffleSwitche usage replaced with WaffleSwitch;
New CourseWaffleFlag added to the temporary module __future__ as FutureCourseWaffleFlag;
Updated all the imports to use CourseWaffleFlag from the __future__ module;

BREAKING CHANGE: A number of toggle related constants (e.g. ENABLE_ACCESSIBILITY_POLICY_PAGE)
changed types. They were strings, and are now toggle instances (e.g. WaffleSwitch). Although the entire
refactor should be self-contained in edx-platform, if any plugins or dependencies were directly
using these constants, they will break. If this is the case, try to find a better publicized way of
exposing those toggles.
2022-05-05 12:03:10 -04:00
Zainab Amir
921dadac99 feat: add password compliance check for login (#30149)
Add nudge and block checks for HIBP API on login view

VAN-667
VAN-668
2022-04-05 11:18:52 +05:00
Shafqat Farhan
df22dfbe0d feat: VAN-669 - Disallow bad passwords on Registration 2022-03-25 15:00:07 +05:00
Robert Raposa
9fa79809d8 refactor: CookieMonitoringMiddleware moved to edx-django-utils
The CookieMonitoringMiddleware and its related script
moved to edx-django-utils.

ARCHBOM-2054
2022-03-17 16:59:00 -04:00
Ali Akbar
c4b788baf2 Merge pull request #30028 from openedx/aakbar/PROD-2521-retired-email-msg
feat: add retired email msg
2022-03-11 11:05:45 +05:00
AliAkbar
06365735d4 feat: add retired email msg 2022-03-10 22:46:44 +05:00
Robert Raposa
29e50710dc feat: enhance cookie monitoring and logging
Contains a number of cookie monitoring changes.

Enhancements:
- Add sampling capability for cookie logging on headers
 smaller than the threshold. For details, see
 COOKIE_SAMPLING_REQUEST_COUNT.
- Add cookie header size to log message.
- Sort logged cookies starting with largest cookie.
- Move logging from Middleware request processing
 to response processing to ensure the user id is
 available for logging for authenticated calls.
- Added cookies.header.size.computed to check
 if there are any large hidden duplicate cookies.
 Can be compared against the cookies.header.size
 custom attribute.
- Add delimiters into logs to make it simpler to parse
 when the logging tools accidentally exports multiple
 log lines together.

Removed:
- Legacy cookie capture code. This code was dangerous to
  to enable and provided more limited insight than the
  newer logging, so this was removed to simplify the code.

Other refactors:
- Switched Middleware to use new Django format, rather
 than the Mixin.
- Moved tests to its own test class. Note: this
 middleware is likely to move to a separate
 library.

ARCHBOM-2055
2022-03-09 20:39:27 -05:00
Mohammad Ahtasham ul Hassan
68e0885ca8 fix: fixed django4 warnings (#29644) 2022-03-07 15:50:17 +05:00
Mohammad Ahtasham ul Hassan
a838ab4b01 fix: fixed django4 warnings (#29643) 2022-03-04 15:03:02 +05:00
Simon Chen
0b158a8a42 feat: provide new verification details endpoint for support-tools (#30004)
Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
2022-03-03 10:33:14 -05:00
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