Commit Graph

6448 Commits

Author SHA1 Message Date
Chris Chávez
51bfd3febe feat: Add blockType to xblockPreview & title to xblock_iframe [FC-0097] (#37362)
- Adds `blockType` and `is_modified` to the `showXBlockLibraryChangesPreview` iframe message.
- Add title to the `xblock_iframe`
- Add `is-modified` to `studio_xblock_wrapper`
- Add `disable_staff_debug_info` as a query param in `render_xblock`
- `downstream_is_modified` added to ComponentLink and ContainerLink
2025-09-29 23:27:32 +00:00
Muhammad Arslan
51ac947caf fix: always generate block structure from "published-only" branch (#37335)
Block structures are meant to be an optimization for the LMS, meaning
that they should always be collecting from the published branch of
modulestore. This is what happens by default when it's run from the LMS
celery process, but this code is sometimes invoked from a Studio worker
(e.g. development mode celery, running in immediate in-proc mode).

---------

Co-authored-by: Peter Pinch <pdpinch@mit.edu>
2025-09-26 20:58:12 -04:00
Kyle McCormick
7275ce1634 feat!: modulestore_migrator (#36873)
This introduces the modulestore_migrator app, which can be
used to copy content (courses and libraries) from modulestore
into Learning Core. It is currently aimed to work on the legacy
library -> v2 library migration, but it will be used in the future
for course->library and course->course migrations.

This includes an initial REST API, Django admin interface,
and Python API.

Closes: https://github.com/openedx/edx-platform/issues/37211

Requires some follow-up work before this is production-ready:
https://github.com/openedx/edx-platform/issues/37259

Co-authored-by: Andrii <andrii.hantkovskyi@raccoongang.com>
Co-authored-by: Maksim Sokolskiy <maksim.sokolskiy@raccoongang.com>
2025-09-24 11:02:05 -04:00
Feanil Patel
f120a7cac5 Merge pull request #37067 from WGU-Open-edX/collapse-features-dictionary
refactor: flatten FEATURES dictionary with backward compatible proxy
2025-09-18 10:39:48 -04:00
Kaustav Banerjee
6b48ff9470 feat: add ability to override middlewares for recurring nudges
* feat: add ability to override middlewares for recurring nudges

* feat: add ability to run command for all sites
2025-09-17 21:52:39 +05:30
Navin Karkera
a11086ffac feat: allow editing imported text blocks (#37124)
* feat: allow editing html block imported from upstream

The modified field is left untouched in future sync while storing the
upstream values in hidden fields to allow authors to revert to upstream
version at any point.

* fix: sync downstream_customized field for copy-pasted modified block

* test: add more tests

* fix: lint issues

* test: copy paste

* feat: skip sync if html data is modified

* feat: update upstream fields only when modified

* refactor: use version_synced field to skip sync

* feat: edit title inplace for library source components

* fixup! feat: edit title inplace for library source components

* fix: edit title button style

* fix: test case

* fix: lint issue

* refactor: don't show different icon for modified upstream blocks

* Revert "refactor: use version_synced field to skip sync"

This reverts commit 8b784fff2f49b43702c952e7f955bd4048e8cc69.

* feat: only skip sync for modified blocks if updated as part of container

* refactor: update sync behaviour when synced individually and as part of parent

* feat: include ready to sync children info in downstream link get api

* test: fix failing tests

* fix: lint issues

* feat: new tests and update api to allow overriding modified fields in sync

* test: api changes

* refactor: edit options should be visible for individual imports

* docs: update api docs

* chore: remove old comments
2025-09-17 14:50:24 +05:30
Ali-Salman29
539666dc40 feat!: remove cs_comments_service support for forum's content APIs
- This will force the use of the new v2 forum's APIs for Threads & Comment.
- Update params for get_user_subscription function. It uses the same structure as we have in the get_user_threads.
2025-09-15 09:10:06 -04:00
Muhammad Adeel Tajamul
51a254a45c feat: added feature to rate limit secondary email change (#37356) 2025-09-15 13:45:46 +05:00
Muhammad Adeel Tajamul
1a081f23c0 feat: added configurable param to rate limit email change in account settings (#37349) 2025-09-12 18:21:10 +05:00
Krish Tyagi
a403f4bcc4 chore!: removing of pyjwkest dependency from edx-platform (#37159) 2025-09-11 08:24:17 -04:00
coder1918
790a67a0d1 refactor: flatten FEATURES dictionary with backward compatible proxy 2025-09-09 14:11:39 -06:00
Nathan Sprenkle
cb7f0f4811 fix: fix bad serialization of courseware metadata (#37338)
* Formats single_paid_mode as a dict, rather than named tuple which couldn't be serialized to DictField
* Allow ecommerce_checkout_link to be empty

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-09 14:18:20 -04:00
Taimoor Ahmed
ed45fbba37 fix: Invalid read param in forum thread api
This PR fixes the invalid read parameter being passed in forum update_thread api.
this was somehow introduced in this commit 6f522f3992 (diff-b9d08209a02c673887f6ca72b0018758174e95508539adbcb6885f22c7844eb8L292)
2025-09-08 11:17:10 -04:00
Ram Chandra Bhavirisetty
42afa1bb62 chore: remove deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings (#37002) 2025-09-05 17:52:33 -04:00
Feanil Patel
06b54e79f2 Merge pull request #36845 from raccoongang/rg/axm-course-catalog-extend-courseware-api
feat: [FC-86] extend courseware api with new fields
2025-09-04 09:46:25 -04:00
Serhii Nanai
ed69cb554b fix: remove unused fields 'prerequisites', 'ocw_links' 2025-09-03 12:38:08 +03:00
Moncef Abboud
9c90fa0dd1 feat: tpa automatic logout with a single redirect 2025-09-01 13:23:45 +02:00
Hassan Raza
515ce7f791 chore: Management command to update preferences (#37297) 2025-09-01 13:08:43 +05:00
Serhii Nanai
577ef63a78 docs: add comment for skip_unless_lms 2025-08-29 13:30:35 +03:00
Serhii Nanai
b0ecbdfbd6 refactor: move import inside testcase
refactor: fix unused imports
2025-08-29 13:30:35 +03:00
Muhammad Adeel Tajamul
acad883a38 fix: added info in notification preferences (#37295) 2025-08-29 11:41:28 +05:00
Serhii Nanai
3a8366e053 docs: update docstring for course info serializer 2025-08-28 18:00:44 +03:00
Serhii Nanai
fa2eddb775 docs: update docstring for prerequisite course serializer 2025-08-28 17:58:06 +03:00
Mubbshar Anwar
4a27f9cbb5 fix: fix timezone for Django 5.2 (#37293) 2025-08-28 11:16:51 +05:00
Awais Qureshi
ec83b2aa64 fix: Updated tuple unpacking of signal receivers to match current structure in django52. (#37249) 2025-08-27 17:38:08 +05:00
Eemaan Amir
3b50dbb933 chore: remove edx.notifications.preferences.viewed event (#37285) 2025-08-27 17:04:04 +05:00
Muhammad Adeel Tajamul
abd305df85 feat: added rate limit on one click unsubscribe api (#37272)
* feat: added rate limit on one click unsubscribe api

* fix: fixed failing test

* chore: raise 400 error on invalid username

* fix: fixed pylint
2025-08-27 16:58:06 +05:00
Taimoor Ahmed
7e80061e39 fix: Discussion xblock error when loading for the first time
This PR fixes the user not being created when accessing the discussion xblock as the course_key was missing in some of the api calls and that lead to the forum backend not being fetched correctly.
2025-08-25 09:12:19 -04:00
Tarun Tak
6f13c1e1cd fix!: session ID stability while maintaining inactivity timeout (#36896)
This change modifies the SessionInactivityTimeout middleware to prevent
the session ID from changing on every request while still enforcing the
inactivity timeout.

Key improvements:
- Store datetime values as ISO strings for proper serialization
- Implement hybrid session save approach that only allows full session
  saves periodically (controlled by SESSION_SAVE_FREQUENCY_SECONDS)
- Preserve session ID between requests while still tracking user activity

This resolves the issue where lms_sessionid was changing on every user
interaction, which caused problems.

BREAKING CHANGE: The breaking change is that SESSION_ACTIVITY_SAVE_DELAY_SECONDS was introduced with a 15 minute default, which will change the current behavior. It is not necessarily breaking (since it actually fixes an issue), but this is to bring more attention to the new setting because the default is reasonable, but also somewhat arbitrary.
2025-08-21 23:15:12 -04:00
Navin Karkera
617b6447cc feat: reindex course and recreate upstream links post import and course re-run (#37237)
Index the newly created course after import and course re-run. Also recreate upstream links after course re-run.

We make use of newly created COURSE_RERUN_COMPLETED signal to run post re-run processes.
2025-08-21 18:15:55 +00:00
Awais Qureshi
98f4756d09 fix: Passing unsaved model instances to related filters is no longer … (#37227)
* fix: Passing unsaved model instances to related filters is no longer allowed.
2025-08-20 11:16:20 +05:00
Usama Sadiq
be438f1554 fix: pylint warning arguments-differ (#37234) 2025-08-19 15:24:15 +05:00
Chris Chávez
af01129316 feat: API to retrieve library block/container hierarchy (#36813)
* test: Test for publish section/subsection

* test: published_by is now None for unpublished containers

* test: adds TODO comments to the tests

in anticipation of publishing container children

* feat: adds api to retrieve library block/container hierarchy

* test: adds query counts for hierarchy API tests

These are really high, but highlight the need for future optimizations.

* perf: reduce hierarchy API query counts

* perf: cut query counts in half

Required a refactor of the approach to avoid using the Metadata classes.

* chore: trigger ci

* chore: update openedx-learning constraint

* chore: compile requirements

* test: updating query count

* style: Add missing comment in kernel.in

* fix: get_container_from_key param and comments

* docs: mark api as UNSTABLE and add comment about get_library_object_hierarchy implementation

---------

Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
2025-08-18 18:15:47 -07:00
Chris Chávez
ec72dc7998 feat: Add top-level parent logic to Upstream/Dowstream links [FC-0097] (#37076)
- Adds the `top_level_parent_usage_key` to the `EntityLinkBase`
- This field is used to save the top-level parent of a component or container when it is imported into a course. Example: A unit with components imported into a course. The unit is the top-level parent of the components.
- Updates the `DownstreamListView` to return the top-level parents instead of downstream child, if this parent exists.
- Each time containers with children were synchronized, a new downstream block was created for each child instead of updating the existing one. This occurred because the `upstream_key` was incorrectly validated as an `Opaquekey` against a list of key strings. This was fixed by converting the `upstream_key` to a string before the verification. (see 34cd5a4781 and 29647831dc)
- Which edX user roles will this change impact?  "Course Author", "Developer".
2025-08-14 17:36:30 +00:00
Rômulo Penido
1a9f6e15a5 feat: copy/paste containers (units/subsections/sections) in Studio (#37008)
* feat: copy endpoint for Library Containers

* fix: make source_usage_key optional and removing upstram info for xblock olx

* test: add tests

* refactor: remove unecessary changes to reduce diff

* fix: change assert

* feat: add `write_upstream` field to ContainerSerializer

* fix: remove comment

* refactor: change `source_usage_key` type and more

* fix: try to infer the source version

* fix: InvalidKeyError while copying container with assets

* fix: read source_version from OLX

* fix: remove store check

* fix: change ident

Co-authored-by: Braden MacDonald <mail@bradenm.com>

* feat: fill source_version and make get_component_version_from_block public

* refactor: rename `source_key` to `copied_from_block`

* test: add test to `write_copied_from=false`

* fix: removing unused fallback elif

* fix: remove `copied_from_block` param

---------

Co-authored-by: Braden MacDonald <mail@bradenm.com>
2025-08-14 08:06:35 -07:00
Mubbshar Anwar
ee8b19442d fix: Remove assertQuerysetEqual (#37200)
replace assertQuerysetEqual with assertEqual dut to deprecation in Django 5.2
2025-08-13 22:24:08 +05:00
M. Sumair Khokhar
eb66c5d88b fix: test failure in test_all_languages (#37201)
* fix: test failure in test_all_languages
2025-08-13 22:18:41 +05:00
Feanil Patel
2a53e2e561 Merge pull request #37165 from openedx/feanil/remove_unnecessary_pin
feanil/remove unnecessary pin
2025-08-13 08:57:57 -04:00
Mubbshar Anwar
b52e72f6e0 fix: fix timezone utc for 52 (#37199)
The django.utils.timezone.utc is removed in Django 5.1.

issue: 37151
2025-08-13 17:46:17 +05:00
Hassan Raza
9a8dc51535 chore: Handle forbidden username exceptions on registration (#37185) 2025-08-13 12:34:11 +05:00
Feanil Patel
bf62862b9f test: Fix notifacitons test for new DRF version.
DRF was swallowing an underlying error string and providing its own
which was being checked for here.

See https://github.com/encode/django-rest-framework/pull/8051 for
details.

The new version fixes that underlying issue and so the test failed.

Rather than checking for the exact string of the 404 which is not
relevant, we now just verify that the error code associated with the
request matches the HTTP response. This should make the test more
resilient to future text changes in the underlying Django function
`get_object_or_404`
2025-08-12 16:08:29 -04:00
Feanil Patel
7121d4e466 fix: Correct serializer model reference.
When linking a DRF serializer with a model, you need to link it to the
model class not an instance of the model.

The newer version of DRF tries to access the model_manager from the
model here and runs into issues if it's not defined correctly.
2025-08-12 13:59:40 -04:00
Feanil Patel
b370064978 test: Reduce query count.
Previously we were doing the following query:

SELECT 1 AS "a" FROM "user_api_userpreference" WHERE ("user_api_userpreference"."key" = 'pref-lang' AND "user_api_userpreference"."user_id" = 1 AND NOT ("user_api_userpreference"."id" = 1)) LIMIT 1

Looking at the middleware, I don't see why this was previously
happening.
2025-08-12 12:22:05 -04:00
Muhammad Adeel Tajamul
e8b58f770e feat: updated one click unsubscribe to use account level preference model (#37161) 2025-08-12 16:44:42 +05:00
Mubbshar Anwar
a41a413983 chore: Remove assertQuerysetEqual (#37182)
replace assertQuerysetEqual with assertEqual dut to deprecation in Django 5.2
2025-08-12 11:14:16 +05:00
Awais Qureshi
421da0a947 fix: Correctly handle Django lazy translation objects. (#37155) 2025-08-11 10:03:46 -04:00
jawad khan
f4d52e070b Fixed jwt scope issue (#37134)
* fix: Fixed jwt scope issue

* fix: fixed test cases
2025-08-08 11:01:21 +05:00
Syed Sajjad Hussain Shah
31a5ca4d8a feat: make credit provider info fetching pluggable (#37129)
* feat: make credit provider info fetching pluggable
2025-08-07 19:55:53 +05:00
Feanil Patel
7a1788b159 Merge pull request #36910 from dwong2708/django5-storage-36739
feat: deprecate get_storage_class in core/storage.py
2025-08-07 10:07:44 -04:00
M. Sumair Khokhar
628e73ba12 fix: studio swagger api-docs crashes with 500 error (#37099)
* fix: studio api-docs crashes with 500 error
2025-08-07 12:25:08 +05:00