Commit Graph

6522 Commits

Author SHA1 Message Date
Maria Grimaldi
ec69659253 feat: integrate cohort assignment filter definition to cohort model 2022-06-13 11:28:01 -04:00
ruzniaievdm
116431cb81 refactor: Replace PDF course certificate view code (#30397)
Co-authored-by: ruzniaievdm <ruzniaievdm@gmail.com>
2022-06-13 09:43:02 -04:00
Feanil Patel
b9131ac1af Merge pull request #30299 from raccoongang/depr/remove-course-info
FC-0001: Remove legacy course info page & related code
2022-06-13 08:23:25 -04:00
muhammad-ammar
415291fd27 feat: add source query param in data sharing consent url 2022-06-13 14:43:51 +05:00
Arunmozhi
ba8e98c710 refactor: move noauth rebind ModuleSystem argument to service (#30320)
This removes the `rebind_noauth_module_to_user` argument from the
ModuleSystem constructor and moves it to a separate service called
"rebinder" in the class `RebindModuleService`. This is used in the
LTI module to bind calls received by its noauth endpoint to bind
the module the real_user.
2022-06-08 20:26:59 +02:00
Demid
8886f29e52 refactor: remove debug property from ModuleSystem (#30450)
This also:
1. Removes this property from XBlock runtime shims.
2. Updates the minimum required version of the LTI Consumer XBlock.
2022-06-08 18:59:45 +02:00
Arunmozhi
c54d8a81bf refactor: deprecate node_path attribute of ModuleSystem (#30447)
The node_path attribute & constructor argument of the ModuleSystem is
deprecated without any replacement service or fallback as there doesn't
seem to be any core blocks using it.

It also removes the references to node_path from the LMS settings, the
LoncapaModuleSystem and the XBlock runtime shim.

Co-authored-by: Agrendalath <piotr@surowiec.it>
2022-06-08 18:06:59 +02:00
Mohammad Ahtasham ul Hassan
22e510d69b fix: remove logging (#30559) 2022-06-08 20:31:52 +05:00
connorhaugh
ab59796a56 fix: python-dateutil version issue 2022-06-07 14:33:44 +05:00
Kyle McCormick
9f380b9ccd refactor: import common/lib/ modules from canonical locations (#30533)
Unfortunately, some code in edx-platform is imported
relative to sub-projects instead of the repository root.
The only three remaining instances of this are:
* common/lib/xmodule/xmodule (imported as just 'xmodule')
* common/lib/capa/capa (imported as just 'capa')
* openedx/core/lib/xblock_builtin/xblock_discussion
  (imported as just 'xblock_discussion')

For more details on the situation, see:
https://openedx.atlassian.net/browse/BOM-2579
(public, but requires Atlassian account creation).

We would like to get to a point where all edx-platform
import paths match their folder paths, relative to the repo
root. For now, though, all common/lib/capa and common/lib/xmodule
code should be imported as just `from capa` and `from xmodule`,
respectively. Importing using the full `common.lib.xmodule.xmodule...`
path will often work, but it instantiates a second instance of all
modules imported this way, which in the past has led to very
difficult-to-diagnose bugs.  It also confuses tooling such as
import-linter, which we are trying to add to edx-platform
(see https://openedx.atlassian.net/browse/BOM-2576)
2022-06-06 09:54:16 -04:00
Sagirov Eugeniy
92ca176fde refactor: Remove legacy course info page & related code 2022-06-05 19:00:05 +03: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
Régis Behmo
7d4543814d refactor: less confusing ACE configuration (#27719)
The ACE_* settings from lms/envs/common.py are all ignored because they are
overloaded by the plugin settings. We were recently bitten by this, as we
discovered that the ACE_ROUTING_KEY was incorrectly set to 'edx.core.low'.
Here, we fix this default value and remove ACE_* settings from
lms/envs/common.py to avoid confusion.

See: https://github.com/overhangio/tutor/issues/439
2022-06-02 14:21:19 -04:00
Kshitij Sobti
a63d023fb6 fix: Run course discussion settings update task when settings change (#30520)
When discussion settings change in a course, call the discussion settings update task so that topics are updated automatically.
2022-06-02 11:04:11 +05:00
Brian Beggs
05f54e8074 Merge pull request #30484 from open-craft/navin/fix-domain-name-length
fix: [BB-6261] trim name for site configuration before saving
2022-06-01 12:58:55 -04:00
Usama Sadiq
259084ed77 Revert "BOM-2245 : Unpin python-dateutil" (#30515) 2022-05-31 21:02:59 +05:00
Navin Karkera
1172dd00e5 fix: [BB-6261] warn and trim name for site configuration before saving 2022-05-31 19:56:40 +05:30
M Umar Khan
3492bede44 fix: python-dateutil version issue 2022-05-31 17:51:26 +05:00
Zainab Amir
c1324588c3 feat: send is_marketable field to braze (#30501) 2022-05-27 15:37:44 +05: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
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
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
Syed Sajjad Hussain Shah
2fc04e65db fix: Name field validation issue from lms [VAN-965] 2022-05-25 14:56:38 +05: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
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
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
583b36938e fix: fix ResourceWarnings (#30317) 2022-05-24 11:44:45 +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
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
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
adeel.tajamul
8ef0b18f06 fix: cohorts api not working 2022-05-20 11:33:27 +05:00
Robert Raposa
3fc852f53c feat!: change JWT access token expires (#30432)
Introduces JWT_ACCESS_TOKEN_EXPIRE_SECONDS setting. This is the number
of seconds a JWT access token remains valid. We use this custom
setting for JWT formatted access tokens, rather than the
django-oauth-toolkit setting ACCESS_TOKEN_EXPIRE_SECONDS, because the
JWT is non-revocable and we want it to be shorter lived than the
legacy Bearer (opaque) access tokens, and thus to have a smaller
default.

BREAKING CHANGE: The thing that is breaking is that JWT access tokens
will now have a 1 hour default, instead of a 10 hours default. If
third-party scripts are appropriately checking/refreshing the access
token, this should be ok. However, you can always override with a
longer duration temporarily. From a security perspective, we don't
recommend a longer duration, and you may consider a shorter duration.

ARCHBOM-2099
2022-05-19 09:46:17 -04:00
Maria Grimaldi
0edb0bb8b6 Merge pull request #29964 from eduNEXT/MJG/cohort-change-filter
[BD-32] feat: add cohort change Open edX Filter
2022-05-13 13:22:40 -04:00
Feanil Patel
661949771a Merge pull request #30347 from raccoongang/remove-verified-track-cohort
FC-0001: Remove verified track cohort
2022-05-13 09:47:13 -04:00
Eugene Dyudyunov
52dd883a3c refactor: delete now unused FutureCourseWaffleFlag (#30367)
Remove temporary FutureCourseWaffleFlag class;
Update ora2 and edx-toggles to versions cleaned from the
LegacyWaffle* classes;
Replace `override_flag`s with `override_waffle_flag`;
Replace `override_switch`s with `override_waffle_switch` (where it's possible).
2022-05-13 08:48:42 -04:00
Ahtisham Shahid
674778fc7a Removed PII sharing requirement from Live API (#30332) 2022-05-11 19:43:56 +05:00
Muhammad Adeel Tajamul
93dbb03984 Revert "feat: removed piazza from discussion providers" 2022-05-11 13:27:38 +05:00
Abdurrahman Asad
f22a129b23 fix: discussion moderators can't create posts for specific cohorts (#30352)
fix: discussion moderators can't create posts for specific cohorts
2022-05-11 09:41:48 +05:00
Eugene Dyudyunov
655e4a344f refactor!: update CourseWaffleFlag (#30351)
BREAKING: get rid of the LegacyWaffle-based CourseWaffleFlag.
Both CourseWaffleFlag and FutureCourseWaffleFlag now use the modern
WaffleFlag as parent class. FutureCourseWaffleFlag left to support ORA
transition to modern waffle.

Switch to the ORA version which supporting new Waffles.
2022-05-10 15:08:59 -04:00
Demid
a4ec4c1b8e refactor: Delete XModule classes (#30262)
Removes XModule, XModuleDescriptor, ProxyAttribute classes and their usages.
2022-05-10 19:09:11 +02:00
Muhammad Adeel Tajamul
90184cc765 Merge pull request #30362 from openedx/inf-185
feat: removed piazza from discussion providers
2022-05-10 16:54:01 +05:00
Muneeb Ur Rehman
20a0e6e9e1 feat: create learner pathway skeleton (#30355)
* feat: create skeleton for learner_pathway app

* feat: add learner_pathway app for quality checks

* feat: add verbose name and dir for tests

* feat: add docstrings for files in app

* fix: remove unused imports

* refactor: resolve quality issues
2022-05-10 13:19:45 +05:00
adeel.tajamul
0b69c7b638 feat: removed piazza from discussion providers 2022-05-10 12:28:07 +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
Simon Chen
192b35eb8f fix: add Learner as another role posted to LTI tools for the LTI embed (#30356)
Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
2022-05-09 10:12:28 -04:00
Maria Grimaldi
aacfb393d6 Merge pull request #30130 from open-craft/pooja/convert-warning-back-to-html
[BB-6041] Convert password compliance warning to html
2022-05-09 09:05:44 -04:00
Tim McCormack
80f60ffb36 refactor: Move log_sensitive to edx-django-utils (#30349)
It was copied there in 4.7.0 (openedx/edx-django-utils#209) so it can be used in more IDAs.

Includes dropping dependency on PyNacl, which was only in use by that module.
2022-05-06 12:42:19 +00: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