Commit Graph

67615 Commits

Author SHA1 Message Date
salmannawaz
d516736482 refactor: Convert BuiltIn Video Block's html from mako to django template (#37509)
Closes: https://github.com/openedx/public-engineering/issues/427
2025-11-18 10:59:11 -05:00
Feanil Patel
afe5dab47d Merge pull request #37648 from openedx/repo-tools/upgrade-python-requirements-93bb80b
chore: Upgrade Python requirements
2025-11-18 10:51:49 -05:00
edX requirements bot
67e686ca97 chore: Upgrade Python requirements 2025-11-17 21:42:18 -05:00
Feanil Patel
93bb80bd26 Merge pull request #37385 from openedx/feanil/drop_name_affirmation
feat!: Drop edx-name-affirmation as a dependency.
2025-11-17 10:37:43 -05:00
Muhammad Farhan Khan
a50ab7d75f chore: Move waffle flags, configs (used in video block) to video service
Merge pull request #37631 from openedx/farhan/add-waffle-flags
2025-11-17 17:52:29 +05:00
Muhammad Farhan Khan
f51343c871 refactor: move transcripts_utils from xmodule to video-config (#37600)
As part of the ongoing effort to deprecate and eventually remove xmodule,
we’ve started gradually migrating the necessary code files from xmodule
to more appropriate locations within the codebase.

Ticket: https://github.com/openedx/public-engineering/issues/445

Also: this tweaks importlinter ignores & add follow-up issue links

Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-11-14 18:26:35 +00:00
Chris Chávez
fcf03cc710 feat: get migrations info REST-API added [FC-0112] (#37558)
- Adds the get migrations info REST-API.
- Add missing title to CourseDetails population.
2025-11-14 17:38:40 +00:00
Haftamu Kebede
f32f8e8ac3 fix: Resolves faling tests when CERTIFICATE_LINKEDIN setting is configured at common.py #37428 (#37437)
In order to be able to share course certificate to LinkedIn, configure
SOCIAL_SHARING_SETTINGS with a value True for CERTIFICATE_LINKEDIN
entry. The setting is not available by default, but when used there
were failing tests and this change ensures all tests pass.

Fixes: https://github.com/openedx/edx-platform/issues/37428#issuecomment-3372788757
2025-11-14 09:05:47 -05:00
María Fernanda Magallanes
f4f14a6987 [FC-0099] feat: add openedx-authz to library apis user_can_create_library and require_permission_for_library_key (#37501)
* feat: add the authz check to the library api function

feat: add the authz publish check in rest_api blocks and containers

feat: add the authz checks in libraries and refactor

feat: add collections checks

feat: update enforcement in serializer file

refactor: refactor the permission check functions

fix: fix value error

fix: calling the queries twice

* test: add structure for test and apply feedback

refactor: refactor the tests and apply feedback

fix: apply feedback

Revert "refactor: refactor the tests and apply feedback"

This reverts commit aa0bd527dd7bc7dec4a7ad7adb41a3c932f4a587.

refactor: use constants and avoid mapping

test: fix the test to have them in order

docs: about we rely on bridgekeeper and the old check for two cases

docs: update openedx/core/djangoapps/content_libraries/api/libraries.py

Co-authored-by: Maria Grimaldi (Majo) <maria.grimaldi@edunext.co>

refactor: use global scope wildcard instead of *

refactor: allow receiving PermissionData objects

refactor: do not inherit from BaseRolesTestCase to favor CL setup methods

If both BaseRolesTestCase and ContentLibrariesRestApiTest define a method
with the same name (e.g., setUp()), Python will use the one found first
in the MRO, which is the one in BaseRolesTestCase because it is
listed first in the class definition leading to unexpected behavior.

refactor: remove unnecessary imports and indent

* chore: bump openedx-authz version
2025-11-13 12:41:40 -05:00
Maria Grimaldi (Majo)
6c6fc5d551 [FC-0099] feat: filter libraries based on user-role scopes (#37564) 2025-11-13 16:33:13 +01:00
Sameen Fatima
8ca34141a6 feat: look up remote_id by remote_id_field_name (#37228) 2025-11-13 09:20:26 +05:00
Chris Chávez
4804c980d4 fix: Call LIBRARY_CONTAINER_PUBLISHED for parent of containers (#37622)
Calls `LIBRARY_CONTAINER_PUBLISHED` when publishing a container that is child of another container.
2025-11-12 18:58:49 +00:00
edX requirements bot
d2f6bb9aa8 chore: Upgrade Python requirements (#37624) 2025-11-12 13:47:53 -05:00
Muhammad Farhan Khan
7b953a5310 refactor: Introduce VideoConfig service, move video sharing methods in it
refactor: Introduce VideoConfig service, move video sharing methods in it
2025-11-11 17:59:36 +05:00
farhan
0cd62bf786 refactor: Introduce VideoConfig service, move video sharing methods in it 2025-11-11 12:55:02 +05:00
David Ormsbee
190a8b8160 fix: bump learning-core to 0.30.0 (#37614)
This pulls in publishing dependency changes from:
https://github.com/openedx/openedx-learning/pull/369

This fixes a bug where publishing a Content Library v2 container would
publish only its direct children instead of publishing all ancestors.

Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-11-07 17:00:50 +00:00
Rômulo Penido
5ef6be4610 feat: add library migration list endpoint [FC-0112] (#37567)
This PR adds the `/api/modulestore_migrator/v1/library/:libraryId/migrations/courses/` endpoint, which returns all course migrations for a target library.
2025-11-07 11:01:35 -05:00
github-actions[bot]
7f8ba45f36 chore: geoip2: update maxmind geolite country database (#37591)
Co-authored-by: feanil <feanil@users.noreply.github.com>
2025-11-06 18:39:34 +00:00
Farhaan Bukhsh
810ea305ca chore: Adds sandbox requirements to ulmo
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2025-11-06 19:31:09 +05:30
edX requirements bot
baa948135d chore: Upgrade Python requirements (#37608) 2025-11-05 16:34:37 +00:00
Navin Karkera
f2f0d87e9e fix: mark container as ready to sync if any child block is deleted
Before this fix, if only a component is deleted, then its parent blocks
were not marked as ready to sync.
2025-11-05 10:36:44 +05:30
Peter Pinch
bbd53a0399 Merge pull request #37569 from mitodl/arslan/fix-validation-api
fix: validation API for certificates
2025-11-03 09:22:26 -05:00
Arslan Ashraf
4df43229bc Merge branch 'master' into arslan/fix-validation-api 2025-11-03 14:03:22 +05:00
salmannawaz
7f0375b6b9 Remove branding related code from video xblock. (#37491)
* chore: remove branding related code from video_block class as it is stop being used, we have plan to remove the specialized VIDEO_CDN_URL in the next phase as after removing URL nothing will reference the branding code so we're removing it first.
2025-11-01 09:22:45 +05:00
Serhiii Nanai
7cd4170ca7 feat: [FC-0092] Optimize Course Info Blocks API (#37122)
The Course Info Blocks API endpoint has been known to be rather slow
to return the response. Previous investigation showed that the major
time sink was the get_course_blocks function, which is called three
times in a single request. This commit aims to improve the response
times by reducing the number of times that this function is called.

Solution Summary

The first time the function get_course_blocks is called, the result
(transformed course blocks) is stored in the current WSGI request
object. Later in the same request, before the second get_course_blocks
call is triggered, the already transformed course blocks are taken
from the request object, and if they are available, get_course_blocks
is not called (if not, it is called as a fallback). Later in the
request, the function is called again as before (see Optimization
Strategy and Difficulties).

Optimization Strategy and Difficulties

The original idea was to fetch and transform the course blocks once
and reuse them in all three cases, which would reduce get_course_blocks
call count to 1. However, this did not turn out to be a viable solution
because of the arguments passed to get_course_blocks. Notably, the
allow_start_dates_in_future boolean flag affects the behavior of
StartDateTransformer, which is a filtering transformer modifying the
block structure returned.

The first two times allow_start_dates_in_future is False, the third
time it is True. Setting it to True in all three cases would mean that
some blocks would be incorrectly included in the response.

This left us with one option - optimize the first two calls. The
difference between the first two calls is the non-filtering
transformers, however the second call applies a subset of transformers
from the first call, so it was safe to apply the superset of
transformers in both cases. This allowed to reduce the number of
function calls to 2. However, the cached structure may be further
mutated by filters downstream, which means we need to cache a copy of
the course structure (not the structure itself). The copy method itself
is quite heavy (it calls deepcopy three times), making the benefits of
this solution much less tangible. In fact, another potential
optimization that was considered was to reuse the collected block
structure (pre-transformation), but since calling copy on a collected
structure proved to be more time-consuming than calling get_collected,
this change was discarded, considering that the goal is to improve
performance.

Revised Solution

To achieve a more tangible performance improvement, it was decided to
modify the previous strategy as follows:

* Pass a for_blocks_view parameter to the get_blocks function to make
  sure the new caching logic only affects the blocks view.
* Collect and cache course blocks with future dates included.
* Include start key in requested fields.
* Reuse the cached blocks in the third call, which is in
  get_course_assignments
* Before returning the response, filter out any blocks with a future
  start date, and also remove the start key if it was not in requested
  fields
2025-10-30 17:23:49 -04:00
Feanil Patel
af8c62684b build: Remove edx-name-affirmation from the exception list.
This should prevent it from accidentally getting added back to the
default build.
2025-10-30 14:40:04 -04:00
Feanil Patel
86032c19a0 test: Remove tests that rely on edx-name-affirmation service being installed
The service is specific to 2U and should not be installed by default.  When we
try to patch objects from that library, that can only be done if the
original object is importable.  So those tests don't make sense to have
in the base system which you should be able to run without the
edx-name-affirmation library.
2025-10-30 14:31:06 -04:00
Tobias Macey
2179109bc2 Merge branch 'master' into arslan/fix-validation-api 2025-10-30 14:20:33 -04:00
Feanil Patel
c2df1500e9 feat!: Drop edx-name-affirmation as a dependency.
This dependency is specific to edx.org and should not be in the default
version of the edx-platform.  There is related code in edx-platform but
circuit breakers should keep that from running for now until we can
clean it up.

BREAKING CHANGE: If you are relying on the edx-name-affirmation app
working, you should install it yourself before running the platform.
2025-10-30 13:59:29 -04:00
Kyle McCormick
ec1d9593d9 fix: Document modulestore_migrator API and remove extra endpoints (#37565)
The OpenAPI docs (at /api-docs) for the modulestore_migrator app were missing
some info, had duplicated info, and had some incorrect info. This brings them
up to a state where they're accurate and should have all the info needed for
someone to integrate with the API. For example:

* We move the viewset class docstrings, which have the info needed for someone
  to POST correctly, into the actual POST handler method docstring. That way,
  they show up under that POST API endpoint rather than the GET API endpoint.
* We fix the target keys to be v2 keys instead of v1 keys.  We add detail on
  all the different migration options and why a user would want to specify
  them.
* We fix the docs for `parameters` field to explain that they are always
  a _list_ of parameter objects, even for non-bulk migration tasks.

This also removes confusing & unnecessary endpoints:

* POST /api/modulestore_migrator/v1/bulk_migration/cancel
* DELETE /api/modulestore_migrator/v1/migrations/<uuid>

Finally, it sorts this endpoint to be newest-first:

* POST /api/modulestore_migrator/v1/migrations

Fixes: https://github.com/openedx/edx-platform/issues/37566
2025-10-30 15:06:46 +00:00
Feanil Patel
d76bed4bbb style: Drop unused imports. (#37572)
* style: Drop unused imports.

I was looking at these files for some other reason and saw that these
imports were unused. Some of it looks like an artifact of the hoisting
of some settings up to the `openedx/env/common.py` file and others look
like some ancient unused imports.


Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-10-30 10:55:38 -04:00
Navin Karkera
72dac75710 fix: lgeacy library block child.save fails in production instance while migrating (#37573)
The child.save() call while migrating legacy library block to library version 2 fails with `InvalidScopeError` due to presence of `LmsFieldData` in` _bound_field_data` field. Removing this call does not seem to have any adverse affect.
2025-10-30 14:53:55 +00:00
Maria Grimaldi (Majo)
e68e39d957 chore: bump openedx-authz version to avoid app not installed exception (#37577) 2025-10-30 15:04:28 +01:00
Michael Roytman
1c44ca034e Merge pull request #37571 from edx/michaelroytman/COSMO2-729-exam-due-dates-self-paced
fix: incorrect LTI exam due dates for self-paced courses
2025-10-30 08:55:45 -04:00
Arslan Ashraf
b9d6a8c788 test: add test 2025-10-30 16:26:07 +05:00
edX requirements bot
48e8688e8e chore: Upgrade Python requirements (#37575) 2025-10-30 16:21:42 +05:00
Navin Karkera
2db3183958 feat: replace is_modified with downstream_customized field in upstream entity api and models (#37563)
This helps the caller to differentiate between the kind of local edits the downstream has and use it accordingly.
2025-10-29 22:22:01 +00:00
Braden MacDonald
4690913a04 feat: remove "experimental" param from reindex_studio (#37546) 2025-10-29 13:52:06 -07:00
Michael Roytman
2c82f230c9 fix: incorrect LTI exam due dates for self-paced courses
These changes fix a bug in how LTI-based exam due dates are computed and written to the exams service. Prior to this change, an LTI exam due date was computed irrespective of the course pacing type. In certain cases, this caused incorrect due dates to be written to the exams service for LTI-based exams.

For example, if a course team initially develops a course as an instructor-paced course and sets a due date on an exam subsection, that subsection due date is written to the modulestore. If the course team subsequently changes that course pacing type to self-paced, then that due date remains in the modulestore to allow course teams to switch pacing types without erasing due dates. The impact of this is that, when the course is published, the exam subsection due date is written to the exams service as the due date, even though there are no static due dates in a self-paced course. Frequently, these due dates are in the past (e.g. for course reruns), so learners automatically cannot access exams. Even if the due date is manually corrected in the exams service, every course publish reverts the due date to the incorrect due date.

This change computes the due date of LTI-based exams as...
* the exam subsection due date if the course is instructor-paced, if the subsection has a due date; else None
* the course end date if the course is self-paced, if the course has an end date; else None

In order to correct any incorrect due dates, course teams should republish their courses.
2025-10-29 16:43:07 -04:00
Kyle McCormick
b033b337a2 docs: Fix types in OldModuleStoreRuntime comments
Just a small find+replace mistake from 
834cb9482d
2025-10-29 15:49:29 -04:00
Kyle McCormick
834cb9482d refactor: rename ModuleStore runtimes now that XModules are gone (#35523)
* Consolidates and renames the runtime used as a base for all the others:
  * Before: `xmodule.x_module:DescriptorSystem` and
            `xmodule.mako_block:MakoDescriptorSystem`.
  * After:  `xmodule.x_module:ModuleStoreRuntime`.

* Co-locates and renames the runtimes for importing course OLX:
  * Before: `xmodule.x_module:XMLParsingSystem` and
            `xmodule.modulestore.xml:ImportSystem`.
  * After:  `xmodule.modulestore.xml:XMLParsingModuleStoreRuntime` and
            `xmodule.modulestore.xml:XMLImportingModuleStoreRuntime`.
  * Note: I would have liked to consolidate these, but it would have
          involved nontrivial test refactoring.

* Renames the stub Old Mongo runtime:
  * Before: `xmodule.modulestore.mongo.base:CachingDescriptorSystem`.
  * After: `xmodule.modulestore.mongo.base:OldModuleStoreRuntime`.

* Renames the Split Mongo runtime, the which is what runs courses in LMS and CMS:
  * Before: `xmodule.modulestore.split_mongo.caching_descriptor_system:CachingDescriptorSystem`.
  * After: `xmodule.modulestore.split_mongo.runtime:SplitModuleStoreRuntime`.

* Renames some of the dummy runtimes used only in unit tests.
2025-10-29 15:46:07 -04:00
Maria Grimaldi (Majo)
31b1e6ecc4 [FC-0099] feat: assign library roles after successful library creation (#37532) 2025-10-29 20:29:02 +01:00
Nathan Sprenkle
6b0af90664 feat: add a default audio codec for the HLS video player (#37525)
This seems to reduce instances of audio garbling when switching levels during HLS video streaming.
2025-10-29 15:24:33 -04:00
Ahtisham Shahid
dc7db1d3ad feat: unpinned social-auth-core (#37550)
* feat: unpinned social-auth-core

feat: unpinned social-auth-core

* fix: updated to resolve failing tests

* fix: resolved linter errors and failing tests

* fix: updated get_attr signature according to new version
2025-10-29 13:16:34 -04:00
Peter Kulko
2a473cffd3 feat: Prevent empty wrapper divs for about sections with no content (#37551) 2025-10-29 10:52:21 -04:00
Arslan Ashraf
3602540bb3 fix: validation API for certificates 2025-10-29 14:13:44 +05:00
Tarun Tak
18d5abb2f6 chore: Replace pytz with zoneinfo for UTC handling - Part 1 (#37523)
First PR to replace pytz with zoneinfo for UTC handling across codebase.

This PR migrates all UTC timezone handling from pytz to Python’s standard
library zoneinfo. The pytz library is now deprecated, and its documentation
recommends using zoneinfo for all new code. This update modernizes our
codebase, removes legacy pytz usage, and ensures compatibility with
current best practices for timezone management in Python 3.9+. No functional
changes to timezone logic - just a direct replacement for UTC handling.

https://github.com/openedx/edx-platform/issues/33980
2025-10-28 16:23:22 -04:00
Daniel Wong
6deb4f8d05 fix: add to search index when creating library from archive (#37526)
Implement full re-index process when creating a library.
2025-10-27 17:53:07 -04:00
Navin Karkera
8aaae4604a fix: index and entity link sync issues on parent block deletion (#37541)
Meilisearch index documents were not synced properly when any block with children blocks like units, subsections, sections etc. were being deleted as the `XBLOCK_DELETED` is only triggered for the deleted block.
This PR fixes it by deleting all index documents that contain the deleted block in its `breadcrumbs` field as only blocks that are children of this block will have it its breadcrumbs field.

Similarly, the entity links that store links between course and library blocks was not synced properly due to children `ContainerLinks` not being deleted.
2025-10-27 13:44:36 -05:00
Deborah Kaplan
121fee3035 feat: display the reset toggles for a report (#37556)
One retirement partner status report admin toggle has  being renamed,
and another has been added. This PR displays them on the appropriate
django admin page.
2025-10-27 17:25:38 +00:00