Commit Graph

6423 Commits

Author SHA1 Message Date
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
Muhammad Adeel Tajamul
acad883a38 fix: added info in notification preferences (#37295) 2025-08-29 11:41:28 +05: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
Daniel Wong
f114399e12 fix: update resolve_storage_backend function and fix tests 2025-08-06 13:25:10 -06:00
Daniel Wong
792a955e73 feat: deprecate get_storage_class in favor to use class import 2025-08-06 13:25:10 -06:00
Daniel Wong
2b9fb55231 feat: deprecate get_storage_class 2025-08-06 13:25:10 -06:00
M. Sumair Khokhar
e5184a07e5 feat!: update finder method to work with django 42 and 52 (#37131) 2025-08-06 15:51:46 +05:00
Muhammad Adeel Tajamul
4cba98c513 temp: added logs for debugging in thread delete (#37127) 2025-08-06 12:06:58 +05:00
jawad khan
e15fa506c0 fix: remove enrollment notification until functionality is live (#37116)
* fix: remove enrollment notification until functionality is live

* fix: updated config version

* fix: fixed test cases
2025-08-05 10:50:45 +05:00
Taylor Payne
16d96565e3 refactor: move production defaults to common modules (#37045)
In the effort to simplify settings in edx-platform, as discussed in ADR 22 -
Settings Simplification, this PR brings some of the production defaults defined
in `lms/envs/production.py` and `cms/envs/production.py` up to
`openedx/envs/common.py` or `lms/envs/common.py` and `cms/envs/common.py` as
appropriate.

Bringing these defaults up from the `production.py` settings modules caused
changes in the rendered settings of the `test.py` modules, and so I have
settings to the `test.py` modules to bring the rendered settings back in line
with what is has been. I have not deeply looked at which settings are needed
for tests to pass or not, but just the differences between the rendered
settings between `master` and this branch.

ADR 22: https://github.com/openedx/edx-platform/blob/master/docs/decisions/0022-settings-simplification.rst
Fixes https://github.com/openedx/edx-platform/issues/36892.
2025-08-04 17:06:16 -04:00
Kyle McCormick
27369b3af7 fix: Sort the output of dump_settings (#37118)
The dump_settings management command is
used for debugging changes to Django settings.
When comparing settings between two branches or
modules side-by-side, it is very useful to have the keys
print out in a deterministic order.

Affects developers only. This has no end-user impact.
2025-08-04 14:43:19 -04:00
Eemaan Amir
0b4c75c21c chore: cleaned up course level preferences (#37106)
* chore: cleaned up course level preferences

* fix: fixed import issue

* fix: fixed lint errors
2025-08-04 12:20:54 +05:00
Hassan Raza
4793f883fc chore: Remove notification app waffle flags (#37086) 2025-08-01 14:59:40 +05:00
Mubbshar Anwar
6d150acf81 refactor: Remove HIBP settings from CMS (#36998)
Remove HIBP settings from CMS common settings module
2025-07-31 09:43:36 -04:00
Eemaan Amir
df7583778e chore: added show_prefrences flag to NotificationPreferencesView (#37085) 2025-07-31 18:19:53 +05:00
Ali-Salman29
d29171c046 feat!: remove cs_comments_service support for forum's subscription APIs
- This will force the use of the new v2 forum's APIs for subscriptions.
2025-07-29 10:44:37 -04:00
Feanil Patel
fcf833e62c build: Updates content_staging based on type checking.
In the serializer, return an empty string if there is no request object.

In content_tagging, just update the type declaration to match the
expectation since it can obviously be a None type.
2025-07-28 10:09:20 -04:00
Eugene Dyudyunov
1ee0f8e225 fix: cohorts api permissions
Fix lack of the permissions for course staff/instructor roles.
Allows course staff/admin users use cohorts API, e.g. for
cohort filters in the Gradebook MFE.
2025-07-25 09:39:36 +03:00
Muhammad Adeel Tajamul
4d76c5ded0 refactor: updated bulk delete api task (#37068) 2025-07-25 11:07:39 +05:00
Muhammad Adeel Tajamul
19cc088399 temp: added logs when bulk deleting comments and threads (#37063) 2025-07-25 04:46:18 +05:00
Hassan Raza
fb124d01f5 feat: add management command to fix 'mixed' values in email_cadence field (#37055) 2025-07-23 13:12:59 +05:00
Kyle McCormick
7a77652cd6 fix: devstack_docker -> devstack
In the context of edx-platform django settings,
devstack_docker is an alias to devstack. Both
are deprecated, technically, but we currently
want to remove all devstack-related settings files
except devstack.py (which tutor still uses). So,
in order to remove devstack_docker.py, we update
its references to devstack.py
2025-07-22 10:27:50 -04:00
Taylor Payne
36327ff27c refactor: import constants into platform-wide settings module 2025-07-21 08:08:34 -04:00