Commit Graph

61471 Commits

Author SHA1 Message Date
Waheed Ahmed
7eb9a45e2d fix: cross-site scripting vulnerability on logout page
The target URL on logout page is marked as safe while rendering and
making the page volunerable to Cross-site scripting vulnerability.

Rendered the target variable outside safe HTML so that it should be
treated as text.

VAN-972
2022-05-31 16:07:05 +05:00
Ahtisham Shahid
c6962a9ba6 fix: added global staff to prevliged access (#30506)
Co-authored-by: AhtishamShahid <ahtishamshahid@A006-00850.local>
2022-05-31 13:01:03 +05:00
Ahtisham Shahid
6214e6beee feat: allow banner for discussions moderators (#30502) 2022-05-31 13:00:41 +05:00
Muhammad Adeel Tajamul
d81f7966fb Merge pull request #30503 from openedx/inf-224-2
fix: thread api will now allow filter by group id
2022-05-31 12:56:32 +05:00
edX requirements bot
0c07e4e388 chore: Updating Python Requirements (#30509) 2022-05-31 10:35:43 +05:00
adeel.tajamul
501ac92bd2 fix: thread api will now allow filter by group id 2022-05-31 07:02:44 +05:00
Mohammad Ahtasham ul Hassan
79b3c82e5f build!: drop node12 support (#30468) 2022-05-30 17:38:31 +05:00
edx-semantic-release
6de1c2fa3f chore(i18n): update translations 2022-05-29 17:07:02 -04:00
Alexander J Sheehan
e0a976ac47 Merge pull request #30453 from openedx/asheehan-edx/saml-api-related-improvements
fix: allowing for provider config fields to be provided on create
2022-05-27 13:16:37 -04:00
Alexander Sheehan
47693769e0 fix: allowing for provider config fields to be provided on create/updates 2022-05-27 12:59:03 -04:00
Adam Stankiewicz
d04ba92ead fix: add segment events to EnterpriseLearnerPortalModal (#30504) 2022-05-27 11:54:01 -04:00
Muhammad Ammar
ceef9bfb1e Merge pull request #30466 from openedx/ammar/send-segment-event-for-first-time-passed-learners
feat: send segment event for learners who passed a course first time
2022-05-27 17:30:23 +05:00
Kshitij Sobti
431b8eb06b fix: revert discussion tab redirection (#30492)
Reverts redirecting to the MFE in the discussion tab since the tab code itself now handles embedding the MFE.
2022-05-27 16:01:24 +05:00
Usama Sadiq
8053b7d90c refactor: replace coursekey.course with coursekey.library (#30398) 2022-05-27 15:55:12 +05:00
Zainab Amir
c1324588c3 feat: send is_marketable field to braze (#30501) 2022-05-27 15:37:44 +05:00
Olivia Ruiz-Knott
de8e9443e4 Merge pull request #30427 from openedx/ork/MICROBA-1818_fix-certificate-available-date-sync-issue
fix: send COURSE_CERT_DATE_CHANGE signal on_commit
2022-05-26 14:46:07 -04:00
oliviaruizknott
74780ad4c0 fix: send COURSE_CERT_DATE_CHANGE signal on_commit
**Previously**
When a course administrator changed the `certificates_display_behavior` (presumably to `end_with_date`) AND set the `certificate_available_date` in Studio, the `certificate_available_date` was not syncing to Credentials.

This was because we chose to send the `certificate_available_date` only if the course is self-paced and the `certificate_display_behavior` is set to `end_with_date`. [See PR #28275](https://github.com/openedx/edx-platform/pull/28275). However, we were checking those two conditions by looking at the relevant `CourseOverview`, which was not yet truly saved to reflect the updated display behavior at the time of the check due to atomic requests. [Read more about atomic requests and transactions here](https://docs.djangoproject.com/en/4.0/topics/db/transactions/#tying-transactions-to-http-requests-1); we have `ATOMIC_REQUESTS` set to `TRUE` in our codebase. Because the `certificate_display_behavior` was not (yet) `end_with_date`, the post to Credentials was not being fired.

**Solution**
To fix, this commit sends the `COURSE_CERT_DATE_CHANGE` signal `on_commit` instead, which waits until the transaction has completed and the update to the `CourseOverview` has been truly applied to the database. [Read more about `on_commit` here](https://docs.djangoproject.com/en/4.0/topics/db/transactions/#django.db.transaction.on_commit). Now, when the relevant `CourseOverview` is read, it will have the updated `certificate_display_behavior`.

See the [Django docs for how to test on_commit callbacks here](https://docs.djangoproject.com/en/3.2/topics/testing/tools/#django.test.TestCase.captureOnCommitCallbacks); this seems to be our first time using the built-in method.

This commit also cleans up some previous code that was meant to get around the problem caused by atomic requests, that is now unneccessary with this fix. It essentially reverses the work done in [PR #26991](https://github.com/openedx/edx-platform/pull/26991): we no longer need to explicitly pass the `certificate_available_date` since we can trust the `CourseOverview` to be properly updated.

**Rejected Solutions**
A. Simply publish the `COURSE_CERT_DATE_CHANGE` signal `on_commit`; no other changes. Rejected because: This would fix the problem, but leaves a lot of unnecessary code and some puzzling inconsistencies. I prefer the solution above because we are cleaning up behind ourselves.

B. Pass the new `certificate_display_behavior` along with the `certificate_available_date`; read those direclty instead of checking the (not-yet-properly-updated) `CourseOverview`. Rejected because: The pattern of passing the new `certificate_available_date` down through all these methods was put in place to get around the atomic requests problem. I believe `on_commit` to be a better solution to getting around that problem. I’d like to move away from passing data down through several functions / methods.

C. Start the celery task `on_commit` (rather than send the signal `on_commit`). Rejected because: The signal receiver basically only starts the celery task, and I find the break to be a bit more readable when sending the signal. No need to split hairs here.

D. Remove the check for pacing and display behavior; send the updated `certificate_available_date` every time there is a change, no matter what the current display behavior is. Rejected because: We intentionally added this check in [PR #28275](https://github.com/openedx/edx-platform/pull/28275) because the task was not behaving as expected without it (specifically around self-paced courses). I assume this is still necessary.

**Relevant Prior Work**
The following PRs--in order--show how this section (and other relevant sections) of the code have been changed over time:
1. [Move cert date signals to avoid race conditions #26841](https://github.com/openedx/edx-platform/pull/26841)
2. [feat: Pass date in cert date update signal #26991](https://github.com/openedx/edx-platform/pull/26991)
3. [Fix certificate available date sync #28275](https://github.com/openedx/edx-platform/pull/28275)
4. [fix: Correct an issue where cert available date was not sent to Crede… #28524](https://github.com/openedx/edx-platform/pull/28524)

MICROBA-1818
2022-05-26 14:09:00 -04:00
Saleem Latif
20e8da3825 Merge pull request #30494 from openedx/saleem-latif/ENT-5796-bug-fix
fix: Fixed a small error related to function return type.
2022-05-26 19:52:43 +05:00
Saleem Latif
97f0ce87ac fix: Fixed a small error related to function return type. 2022-05-26 19:36:38 +05:00
Adam Blackwell
4cd36cb2c4 Revert "feat: add marketing email opt in field" (#30493) 2022-05-26 10:00:50 -04:00
Abdoul Aw
8e1475f585 Merge pull request #30461 from openedx/zamir/VAN-970/add_is_marketable_field_to_use_profile
feat: add marketing email opt in field
2022-05-26 09:20:17 -04:00
muhammad-ammar
cc0690fcda feat: send segment event for learners who passed a course first time 2022-05-26 17:57:30 +05:00
SaadYousaf
2684189127 fix: address UX feedback on reported content email template 2022-05-26 16:59:24 +05:00
Ali Akbar
8528fc07f6 Merge pull request #30464 from openedx/aakbar/PROD-2764-fix-oauth2
fix: use client-credential oauth2 application entry
2022-05-26 11:21:53 +05:00
Robert Raposa
432cde31a5 refactor: add create_jwt_token_dict (#30485)
Moves the functionality from views._get_jwt_dict_from_access_token_dict
to a new method jwt.create_jwt_token_dict, which create a JWT version
of the passed token_dict. Also updates create_jwt_from_token to wrap
this call and return the "access_token" from the dict.

This will hopefully make it less likely that the token
dict attributes could get out of sync with the claims
inside the JWT.
2022-05-25 17:02:19 -04:00
edX requirements bot
d828f155a6 chore: Updating Python Requirements (#30486) 2022-05-25 16:35:11 -04:00
julianajlk
43fb2cc022 fix: Update enrollments FBE status by course key in dashboard (#30483)
REV-2466
2022-05-25 12:01:42 -04:00
Long Lin
1358f99dba chore: bump edx-enterprise version 2022-05-25 10:03:29 -04:00
Robert Raposa
d321ed5ccd refactor: extract shareable jwt methods (#30451)
Extract some jwt related methods to enable reuse across views.
This is in preparation for a change to AccessTokenExchangeView.

Co-authored-by: jawad-khan <jawadkhan444@gmail.com>
2022-05-25 08:53:36 -04:00
Saleem Latif
eb45e53799 Merge pull request #30439 from openedx/saleem-latif/ENT-5796
Enterprise learner with enabled learner portal should be redirect to B2B course about page.
2022-05-25 12:36:02 +05:00
Saleem Latif
f13b0e0e8a feat: Enterprise learner with enabled learner portal should be redirect to B2B course about page. 2022-05-25 12:19:53 +05:00
John Nagro
3b4c86ef42 feat: release edx-enterprise 3.49.4 (#30474)
ENT-5822
2022-05-24 14:44:11 -04:00
julianajlk
f7d4282101 Revert "fix: Use dashboard_index to get FBE status (#30463)" (#30475)
This reverts commit e25e17ee88.
2022-05-24 14:35:47 -04: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
julianajlk
e25e17ee88 fix: Use dashboard_index to get FBE status (#30463)
REV-2466
2022-05-24 10:24:38 -04:00
SaadYousaf
23aa0d39c1 fix: add investigation log for comment client request error 2022-05-24 16:39:40 +05:00
Kyle McCormick
25df9ca420 refactor: make safe_lxml an ordinary folder in openedx/core/lib (#25689) 2022-05-24 15:35:23 +05:00
Usama Sadiq
2ef25e3cfe BOM-2247: Upgrade pip to 22.1 (#30393)
* chore: bump pip to 22.1 & wheel to 0.37.1
2022-05-24 15:15:00 +05:00
edX requirements bot
96a7ebc95c chore: Updating Python Requirements (#30467) 2022-05-24 14:14:17 +05:00
Usama Sadiq
583b36938e fix: fix ResourceWarnings (#30317) 2022-05-24 11:44:45 +05:00
Brian Citro
677e0b8076 Merge pull request #30465 from openedx/bcitro/ENT-5836
fix: release edx-enterprise 3.49.3
2022-05-23 12:44:28 -04:00
Brian Citro
3e166f84d4 fix: release edx-enterprise 3.49.3 2022-05-23 12:21:06 -04:00
AliAkbar
49b2d543e5 fix: use client-credential oauth2 application entry 2022-05-23 19:58:58 +05:00
Zainab Amir
3a43d4344b feat: add marketing email opt in field
Added a new is_marketable field to UserProfile model to store
marketing email opt in field on registration form in UserProfile.

VAN-970
2022-05-23 18:30:57 +05:00
Mohammad Ahtasham ul Hassan
c6d113f26d chore: update Docker Image to use node 16 (#30444) 2022-05-23 15:18:53 +05:00
Muhammad Adeel Tajamul
be13b0d6af Merge pull request #30435 from openedx/inf-224
fix: cohorts api not working
2022-05-23 09:54:44 +05:00
edx-semantic-release
da6a463f33 chore(i18n): update translations 2022-05-22 17:01:52 -04:00
Justin Hynes
dae0de89dd Merge pull request #30448 from openedx/jhynes/microba-1512_mgmt_cmd
feat: Add management command for processing scheduled instructor tasks
2022-05-20 13:49:17 -04:00
Robert Raposa
98d990d7af fix: remove reference to ApplicationOrganization (#30446)
References to ApplicationOrganization were removed two
years ago in the following PR:
https://github.com/openedx/edx-platform/pull/23199

However, it looks like one reference was missed.

ARCHBOM-992
2022-05-20 13:42:12 -04:00
Justin Hynes
8026f74e80 feat: Add management command for processing scheduled instructor tasks
[MICROBA-1512]
* Adds a new management command to the `instructor_task` app that will be used to process scheduled tasks ready for execution by Celery.
2022-05-20 12:50:27 -04:00