Commit Graph

4823 Commits

Author SHA1 Message Date
oliviaruizknott
dbfe2a3f2b feat: notify_credentials of changed overrides
We use the `notify_credentials` management command to keep certificate-
related data in the LMS and Credentials service in sync. We can run it
with specific arguments (user_ids, course_keys, etc.) when we notice a
data discrepancy; and it is run regularly by a Jenkins job with the
`--auto` flag every ~4 hours to keep things up-to-date.

Because we probably never want to notify credentials of of ALL the
GeneratedCertificates, the celery task must be given some arguments
to filter down to the relevant certificates. Running the management
command with the `--auto` flag (as the Jenkins job does) adds
`start_date` and `end_date` arguments of 4 hours ago and now,
respectively.

The handle_notify_credentials celery task then takes those arguments and
looks for any GeneratedCertificates that have been modified within the
given time range by checking the GeneratedCertificate modified_date.
It will send the current data for those certificates to credentials.

However, we also want to notify credentials about certificates that have
an associated CertificateDateOverride that has changed within that time
range: added, updated, or deleted. But changes to a
CertificateDateOverride won’t affect the GeneratedCertificate’s modified
date, and therefore wouldn’t be included in the list of certs cent to
credentials.

This commit adds a check for changed CertificateDateOverrides and
includes their associated GeneratedCertificates in the list of certs. We
use the CertificateDateOverride’s history model for this check so that
we can include certificates whose override was deleted.

MICROBA-1489
2021-09-10 12:32:17 -06:00
Michael Terry
d5bacad86f Merge pull request #28698 from edx/mikix/hide-after-due-mfe
feat: notify MFE when a sequence is hidden-after-due
2021-09-10 09:12:57 -04:00
Michael Terry
cd7d13cd6d feat: notify MFE when a sequence is hidden-after-due
Currently, if a learner manually loads a sequence page that would
normally be skipped for them because it is hidden-after-due, the
sequence renders anyway.

This commit tells the frontend when it should not show a sequence
because it's hidden.

AA-1000
2021-09-09 14:43:00 -04:00
AsadAzam
f721c62555 refactor: Refactor the program configuration string (#28696) 2021-09-09 18:16:39 +05:00
Awais Qureshi
28d2908588 Merge pull request #28649 from edx/upgrade-django-cors-headers-320--
feat: upgrade django-cors-headers to lateast version.
2021-09-09 18:06:01 +05:00
Zainab Amir
40dba56cff fix: auto register send_activation_email task (#28694) 2021-09-09 14:13:35 +05:00
Albert (AJ) St. Aubin
a28f54bf4a feat: Added lms_user_id and email to data sent to Credentials for Program certs
[MICROBA-1466]
2021-09-08 15:05:09 -04:00
Awais Qureshi
36df86d829 feat!: Major upgrade django-cors-headers to new version 3.2.0
BREAKING CHANGES:
- `CORS_ORIGIN_WHITELIST` now requires URI schemes.
- Added new list `CORS_ORIGIN_WHITELIST_WITH_SCHEME` which contains all links of `CORS_ORIGIN_WHITELIST` with schemes and load the desired list after checking installed version.
- For more details, visit this: https://github.com/adamchainz/django-cors-headers/blob/main/HISTORY.rst#320-2019-11-15
2021-09-08 21:39:57 +05:00
Tim McCormack
035dfd8522 feat: Add feature to display a global maintenance banner (#28673)
This is intended for use in the Studio OAuth transition (ARCHBOM-1887) but
may be useful in the future as well.
2021-09-08 16:21:43 +00:00
David Ormsbee
309cadc973 Revert "Use new version of edx-when." (#28684)
Reverting because of errors seen in proctoring. The error from splunk:

 File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edx_proctoring/views.py", line 590, in get
    data['onboarding_release_date'] = effective_start.isoformat()
AttributeError: 'NoneType' object has no attribute 'isoformat'

The effective date is coming from learning_sequences, which ultimately
comes from edx-when.
2021-09-08 11:05:35 -04:00
Zainab Amir
517c4af90c fix: rename send_activation_email task (#28678) 2021-09-08 17:52:03 +05:00
Kshitij Sobti
9f356b90d1 feat!: Add data model for course app API [BD-38] [TNL-8506] [BB-4470] (#28165)
* feat!: Add data model for course app API
The current course apps API makes individual queries to determine if a course app is enabled, which can be inefficient. With this change we now have a Django model that contains this information, allowing us to make bulk queries about all the course apps for a course in the API.
It also adds a new signal handler that initialises the status of all course apps in a course on course publish.

* Use celery tasks and a management commands to make cache async

* Review feedback

* update log messages
use separate celery task for each course task
2021-09-08 11:54:19 +05:00
Zainab Amir
bf76fb3f7f move send_activation_email celery task (#28666)
- moved send_activation_email to user_authn app
- registered task under both new and old name
- exposed the old name for task invocation

VAN-417
2021-09-08 10:44:54 +05:00
Chris Deery
4078443969 fix: [AA-950] Add unit test to verify segment called correctly (#28668)
* fix: [AA-950] Add unit test to verify segment called correctly

Add positive and negative test
Moved flag update to same block as segment
Moved WaffleFlag check to can_show_streak_discount_coupon for consistency
2021-09-07 12:53:13 -04:00
Jawayria
d3a3f52d69 Merge pull request #28613 from edx/jawayria/bom-2773
fix: Replaced '&#39' with '&#x27' to prevent tests from failing on Django 3
2021-09-07 18:34:05 +05:00
kenclary
42e7e785e3 Merge pull request #28551 from edx/juliasq/TNL_8061_optimize_outline_block_data_retrieval
Use new version of edx-when.
2021-09-07 09:31:18 -04:00
Jawayria
b3cb59b07f fix: Replaced '&#39' with '&#x27' to prevent test_reset_password_email from failing on Django 3 2021-09-07 17:31:14 +05:00
Chris Deery
2092933f72 fix: [AA-950] Fix gating feature from WaffleFlag (#28652)
* fix: [AA-950] Fix gating feature from WaffleFlag

Streak Discount was being offered for non-verified courses
2021-09-03 11:31:40 -04:00
Jawayria
9f63dc16a4 Merge pull request #28608 from edx/jawayria/bom-2767
chore: Removed django.utils.lru_cache
2021-09-03 19:37:39 +05:00
Julia Eskew
a4ba37b882 feat: Optimize the querying of course block dates when querying dates for use in a
course outline, which don't need block dates below the subsection level of a course.
Pass the course's published version to all the appropriate places where edx-when's API
is called - to allow edx-when to more efficiently cache queried/processed results.

TNL-8061
2021-09-02 17:45:13 -04:00
Bianca Severino
2497adf22b Merge pull request #28546 from edx/bseverino/pending-name-change
[MST-803] Update account API to allow pending name changes
2021-09-02 14:45:00 -04:00
Felipe Montoya
f0d319ee12 Merge pull request #28266 from eduNEXT/MJG/1st_batch_openedx_events
[BD-32] feat: 1st batch of Open edX Events
2021-09-02 10:08:44 -05:00
mariagrimaldi
c0618592d2 feat: add 1st batch of Open edX events
* Add STUDENT_REGISTRATION_COMPLETED event after the user's registration
* Add SESSION_LOGIN_COMPLETED event after the user's login session
* Add COURSE_ENROLLMENT_CREATED event after the user's enrollment creation
2021-09-02 10:05:23 -04:00
Chris Deery
c4cedbae38 fix: [AA-950] Change coupon flag from WaffleFlag to CourseWaffleFlag (#28623)
Replacing the streak_celebration.discount_experiment_AA759 Waffle flag with
courseware.streak_discount_enabled CourseWaffleFlag

https://openedx.atlassian.net/browse/AA-950

Co-authored-by: cdeery <cdeery@edx.edu>
2021-09-02 08:32:56 -04:00
AsadAzam
36283f1a8b feat! Modify DiscussionsConfiguration to allow programs (#28541)
* feat! Modify DiscussionsConfiguration to allow programs

* feat: add model for program discussions configuration
2021-09-02 13:25:53 +05:00
J. Victor Martins
14e2f29516 feat: Make content libraries an LTI 1.3 tool
Offers blockstore-based content through content libraries acting as an
LTI 1.3 tool:

- Content Library support LTI 1.3 launches offering blockstore-based
  content through resource links.

- Content Library support LTI 1.3. AGS, allowing gradebook updates from
  graded assignments.
2021-09-01 11:56:51 -07:00
Bianca Severino
65905a01ec feat: update account API to allow pending name changes 2021-09-01 11:26:43 -04:00
Chris Deery
8d682cb447 feat: [AA-950] Productize Streak Discount (#28582)
* feat: [AA-950] Productize Streak Discount

- Change STREAK_DISCOUNT_EXPERIMENT_FLAG to STREAK_DISCOUNT_FLAG
- Remove references to "experiment" and ticket AA-759
- Made flag names more consistent
- Move segment event from get_bucket  to streak calculation
- Streak discount event edx.bi.course.streak_discount_enabled is sent when celebrations are calculated
- Convert LegacyWaffleFlags to WaffleFlags

Co-authored-by: cdeery <cdeery@edx.edu>
2021-09-01 10:55:32 -04:00
Jawayria
389bc0d35d chore: Remove django.utils.lru_cache 2021-09-01 13:53:33 +05:00
Zainab Amir
cfc8ab6298 fix: remove edX support URL from login page (#28577) 2021-09-01 11:29:39 +05:00
uzairr
d0c953f261 update session on password change 2021-09-01 02:41:40 +05:00
Jhony Avella
95a6abcd1f revert: removing read_committed argument from outer_atomic function (#28161)
In the PR https://github.com/edx/edx-platform/pull/10659 the outer_atomic decorator/context manager was created to prevent nested atomic blocks. This method received a boolean parameter read_committed to enforce read-committed MySQL isolation level. From Django 2, the default isolation level Django sets is read-committed, so the aforementioned parameter for outer_atomic can be removed
2021-08-31 16:39:35 -04:00
Tim McCormack
f25b395eca feat!: Rename CookieNameChange middleware settings (#28584)
CookieNameChange allowed the use of the expand-contract pattern for
cookies, but the suggested procedure assumed an instantaneous change on
the server side. Without that, there would be a brief window of time where
servers that had received the newer config would be writing cookies that
the servers with old config would not be able to understand.

However, the mechanism can be made seamless by using it *twice* in
succession, with the first usage in a "no-op" configuration. This allows
all the servers to become aware of the new name without using it. The
second change flips the configuration and changes the official name of the
cookie, and during that window both sets of servers are able to understand
both sets of names, even though they're sending a mix of names. This can
then be followed by the usual cleanup.
2021-08-31 16:50:54 +00:00
Jawayria
a5a4ef9fa5 Merge pull request #28590 from edx/jawayria/2768-bom
chore: Removed django.contrib.staticfiles.templatetags.staticfiles
2021-08-31 17:57:50 +05:00
Jawayria
3411cc8744 chore: Removed django.contrib.staticfiles.templatetags.static 2021-08-31 13:40:33 +05:00
Kshitij Sobti
8cf751a405 feat: Add REST APIs for course advanced settings and course tabs
This commit adds new APIs that allow MFEs to modify a course's advanced settings
and to update tab settings to show/hide/move tabs.
2021-08-31 11:11:46 +05:00
Maria Grimaldi
54627e1101 refactor: replace User for UserFactory and its methods
This change is done so the profile is automatically created for tests users
2021-08-30 11:03:49 -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
Manjinder Singh
5d6f163a0b feat: Adding new CookieNameChange middleware (#28404)
Description: Adds a new middleware to help with cookie name changes. It uses the idea of expand and contract, where after we've changed the name, the middleware allows up to accept either a cookie with new name (given higher priority when both are present) or cookie with old name.

This is also helpful when changing domain of a cookie.

impacts: developers, users(anyone that has cookies)
Change depends on django setting changes. See CookieNameChange middleware for more info.
2021-08-25 12:43:21 -04:00
Albert (AJ) St. Aubin
18a3cdaeb8 fix: Correct an issue where cert available date was not sent to Credentials 2021-08-25 11:01:51 -04:00
Kyle McCormick
cd3957b987 fix: upgrade py2neo from 3.1.2 to 2021.1.5 (#28480)
* fix: upgrade py2neo from 3.1.2 to 2021.1.5

The dump_to_neo4j management command has not been working
since the upgrade to python 3.8. The latest version of
python that py2neo 3.1.2 states support for is python 3.5,
so this isn't surprising.

The earliest non-prerelease version of py2neo that supports
python 3.8 is 2020.x (skipping the 4.x and 5.x series). Since
we're going as far as a 2020.x, we may as well upgrade all the
way to the newest series, 2021.x. This commit does that upgrade,
as well as a handful of minor code modifications in order
to handle breaking changes that have been made to the py2neo
API, and some unrelated pin bumps as the result of
'make upgrade'.

This will also require an upgrade of Coursegraph's Neo4j
version from 3.2.x to 3.5.x.

TNL-8386
2021-08-25 09:34:41 -04:00
Maria Grimaldi
2ee52ea96c refactor: replace some create_user with UserFactory to avoid non-existent profile errors 2021-08-24 15:49:21 -04:00
Azan Bin Zahid
de0f42c93e Merge pull request #28289 from edx/azan/PROD-2400
Pact Provider Verification Setup
2021-08-24 17:19:59 +05:00
Zainab Amir
3f0aa42d84 feat: add activation link to registration event (#28513)
Added activation key to the registration event to be used by braze.
Specifically it will be used by activation reminder emails.

VAN-693
2021-08-24 16:12:45 +05:00
Azan Bin Zahid
1cce2e952d feat: add pact verification method 2021-08-24 14:59:46 +05:00
Michael Terry
f49c39ec68 Merge pull request #28506 from edx/mikix/goal-unsubscribe
feat: allow unsubcribing from a course goal with just a token
2021-08-23 14:25:59 -04:00
Michael Terry
2176dd7890 feat: allow unsubcribing from a course goal with just a token
* Add unsubscribe_token uuid field to CourseGoal model
* Add endpoint to unsubcribe from just a token (no login needed)
* Add admin page for the course_goals djangoapp
* Add get_course_overview_or_404 utility method
* Clean up URL handling in course_home_api

AA-907
2021-08-23 12:07:32 -04:00
Albert (AJ) St. Aubin
87d3fc3611 feat: Added detail to the log for failed grade sends to credentials
[MICROBA-1282]

To help with future errors sending grades to Credentials I am adding
additional data to the log message.
2021-08-23 08:58:54 -04:00
oliviaruizknott
e15cc9ac12 fix: Change format of date_override post
Credentials needs the course certificate date override data in a
slightly different format than we were passing it before. Fix!
2021-08-19 14:42:32 -06:00
Kyle McCormick
604fb832f1 docs: document coursegraph app, including devstack instructions (#28489)
Add a README to the coursegraph app, including:

    description/purpose,
    vague deployment instructions,
    devstack instructions,
    example queries, and
    link to the query archive on the wiki.
2021-08-18 17:07:21 -04:00