Commit Graph

7283 Commits

Author SHA1 Message Date
Muhammad Adeel Tajamul
6e48229616 fix: unregistered task of type for email notification (#34751) 2024-05-09 15:16:59 +05:00
Muhammad Adeel Tajamul
c72908f719 fix: updated email digest management command (#34729) 2024-05-08 11:58:01 +05:00
Chris Chávez
b551a32a49 fix: Stop autotagging nor indexing the course root XBlock (#34627)
* fix: Multiple auto-tagging when creating a course

* Avoid tagging course-block and course-info blocks
* Tests

* feat: Avoid create index for course blocks
2024-05-07 11:14:33 -07:00
Kyle D. McCormick
b1393ac3eb fix: fall back to settings.COMPREHENSIVE_THEME_DIRS correctly
There was a logical error in the compile_sass management command:
instead of falling back to settings.COMPREHENSIVE_THEME_DIRS when
--theme-dirs was *None or missing*, we only fell back to it when
--theme-dirs was *missing*.

This caused theme compilation to be skipped when COMREHENSIVE_THEME_DIRS
*is not set* in the environment, even though
settings.COMPREHENSIVE_THEME_DIRS *is set* in Django settings, which
is currently the case for edx.org.
2024-05-07 08:40:40 -04:00
Kyle D. McCormick
21a1235a28 revert: revert: build: finish replacing paver assets
This reverts commit 4c0284b87d.
2024-05-07 08:40:40 -04:00
Muhammad Adeel Tajamul
a454da9ca6 feat: added daily and weekly email digest (#34539)
* feat: added daily and weekly email digest
2024-05-07 12:15:03 +05:00
Kyle McCormick
4c0284b87d Revert "build: finish replacing paver assets (#34554)" (#34700)
Reverts #34554, which causes compilation of edX.org's
legacy comprehensive theme to be skipped in their deployment pipeline.
We have not determined the precise cause yet, but it seems like the
compile_sass management command is not correctly getting the
list of comprehensive theme directories from Django settings.
2024-05-06 12:57:51 -04:00
Kyle McCormick
3f0f7ce705 build: finish replacing paver assets (#34554)
Together, these changes make it so that all features of the Paver-based
asset compilation system are supported with drop-in Paver-free
replacements. The remaining Paver asset functions are trivial wrappers,
which can be comfortably deleted before Sumac.

* Turn `./manage.py ... compile_sass` into a simple wrapper around `npm
  run compile-sass`
* Turn `paver webpack` into a simple wrapper around `npm run webpack`
* Turn `pavelib.assets:collect_assets` into a simple wrapper around
  `./manage.py ... collectstatic`
* Add/improve deprecation warnings for all Paver asset commands.
* Load defaults for asset-related Django settings from environment
  variables. This allows the build to work without Python. For the
  settings which will be removed in Sumac, I've added deprecation
  warnings.
* Change EDX_PLATFORM_THEME_DIRS env var to COMPREHENSIVE_THEME_DIRS.
  This simplifies the migration instructions, because all the new env
  vars now match their corresponding Django settings. This amends an
  ADR, but it should not be a breaking change because the  env var was
  recently added (since Quince) and nobody should be using it yet.
* Future-proof the static assets ADR with links. The linked pages will
  be kept up-to-date even if the ADR isn't.

Part of: https://github.com/openedx/edx-platform/issues/34467
2024-05-06 08:29:45 -04:00
Ahtisham Shahid
f2067ad700 fix: updated ora and pref version (#34696) 2024-05-06 14:29:24 +05:00
Syed Sajjad Hussain Shah
2ce25b3eb6 feat: autogenerate username on registration (#34562)
* feat: autogenerate username on registration

---------

Co-authored-by: Attiya Ishaque <atiya.ishaq@arbisoft.com>
Co-authored-by: Blue <ahtesham-quraish@users.noreply.github.com>
2024-05-02 08:58:37 +05:00
Ahtisham Shahid
2bd73ca96b change notification app name (#34672) 2024-05-01 01:38:30 +05:00
connorhaugh
674c3edaab Revert "Revert "Revert "temp: trace celery tasks in dd"" (#34563)" (#34578)
This reverts commit ebe36a2957.
2024-04-29 13:09:43 -04:00
Rômulo Penido
7fc6cd6755 feat: add usage_key to breadcrumbs in Studio search index (#34535) 2024-04-25 11:00:50 -07:00
Chris Chávez
a33165aaa6 feat: bump openedx-learning to support tagging with multiple taxonomies at once (#34490) 2024-04-25 10:44:47 -07:00
Maria Grimaldi
809ffc3743 feat: connect teams with content groups using dynamic partition generator (#33788)
Implements the connection from the teams feature to the content groups feature. This implementation uses the dynamic partition generator extension point to associate content groups with the users that belong to a Team.

This implementation was heavily inspired by the enrollment tracks dynamic partitions.
2024-04-25 13:02:49 -04:00
Justin Hynes
e2e014cab5 feat!: remove the clean_certificate_available_date mgmt cmd (#34596)
This PR removes the `clean_certificate_available_date` management command. Recently, a change was made to sync the end date of a course run with a display behavior of "end" as its certificate available date in the Credentials IDA. This change was made to resolve a long running issue with the Credentials IDA not displaying certificates to learners correctly on learner records when the display behavior is set to "end".

This management command, if run, would clear the certificate available date from the course certificate configurations in the Credentials IDA. This would be a regression based on the new functionality.  Other improvements have been made to ensure that updates made in the LMS properly flow to Credentials.

TL;DR -- this management command is no longer needed because of feature changes in edx-platform. Allowing this management command to run would break functionality for learners.
2024-04-25 12:02:34 -04:00
Ahtisham Shahid
e76fee1521 fix: resolved key error (#34608) 2024-04-25 02:25:00 +05:00
Usama Sadiq
e91029202e feat: update django-countries (#34603)
* feat: Upgrade Python dependency django-countries (#34602)
---------
Co-authored-by: UsamaSadiq <UsamaSadiq@users.noreply.github.com>
2024-04-24 21:34:32 +05:00
MueezKhan246
15e5631fc0 Merge pull request #34526 from openedx/MueezKhan/Remove-ENABLE_USER_ID_SCOPE-Flag-From-Platform
Removed ENABLE_USER_ID_SCOPE flag from validator
2024-04-24 15:09:06 +05:00
Yusuf Musleh
a31ed929f7 feat: update studio search index when object tags change (#34559)
* feat: Update search index when object tags updated

* feat: Update index when library block tags change

* refactor: Remove extra params

* docs: Add new event to hook events docs

* feat: Add and use upsert_block_tags_index_docs

This takes care of updating tags data in search index for both course and library blocks.

* chore: Update openedx-events

* fix: Update tests + include course block tags in reindex

* feat: Fix static-type issues + adjust tag_object

* fix: bug retrieving the Meilisearch API key UID (first time only)

* docs: Update comments

---------

Co-authored-by: Braden MacDonald <braden@opencraft.com>
2024-04-22 10:53:49 -07:00
Diana Huang
ebe36a2957 Revert "Revert "temp: trace celery tasks in dd"" (#34563)
* Revert "Revert "temp: trace celery tasks in dd (#34537)" (#34553)"

This reverts commit a7b441690d.

* docs: Update removal date on temporary celery flag.
2024-04-22 11:05:50 -04:00
Ahtisham Shahid
4f8a99805d feat: added new ora notification (#34464) 2024-04-22 18:14:26 +05:00
Ahtisham Shahid
5b1d52d811 fix: endorsed post notification audiance updated (#34513) 2024-04-22 13:09:04 +05:00
connorhaugh
a7b441690d Revert "temp: trace celery tasks in dd (#34537)" (#34553)
This reverts commit f866545bb9.
2024-04-19 12:50:33 -07:00
Feanil Patel
6ea123db4d Merge pull request #34528 from openedx/feanil/remove_django_splash
feat!: Remove the django-splash app.
2024-04-19 10:53:46 -04:00
Feanil Patel
6ea63da969 fix: Don't use the deprecated location for Hashable
The Hashable object was moved in python 3.3 and support for the old
location is dropped in python 3.10 the new location is available in
python 3.8 so we can just update this and it should work with both
python 3.8 and 3.11

https://docs.python.org/3.8/library/collections.html
2024-04-18 13:28:30 -04:00
Feanil Patel
b20ac9c515 fix: Be able to clear the process_cache manually in Python 3.11
Given code like the following

```
class Foo:
    @process_cached
    def bar(self):
        pass
```

In Python 3.8 referencing `bar` would not call its `__get__` method.

```
x = Foo().bar
```

However in Python 3.11, making the same call would call the `__get__`
method, permanently replacing the underlying `process_cached` object
with the partial function that references it.

This meant that code to clear the cache would work in Python 3.8 but
would break in 3.11

```
Foo().bar.cache.clear()  # Works in 3.8 but not in 3.11
```

In 3.11 this results in the following error:
```
E       AttributeError: 'functools.partial' object has no attribute 'cache'
```

To make this compatible in both version, we just add the cache as an
accessible attribute on the partial we generate for our wrapped
function.
2024-04-18 13:28:30 -04:00
connorhaugh
f866545bb9 temp: trace celery tasks in dd (#34537) 2024-04-18 13:08:25 -04:00
Rômulo Penido
90b253a38a feat: update Studio search index when course content is updated (#34391) 2024-04-18 09:53:21 -07:00
Feanil Patel
9bd4474f7d test: Reduce query counts now that we dropped django-splash. 2024-04-18 12:43:33 -04:00
Jillian
d67211051b feat: restrict Studio search results based on user permissions (#34471)
* feat: adds SearchAccess model

Stores a numeric ID for each course + library, which will generally be
shorter than the full context_key, so we can pack more of them into the
the Meilisearch search filter.

Also:

* Adds data migration pre-populates the SearchAccess model from the existing
  CourseOverview and ContentLibrary records
* Adds signal handlers to add/remove SearchAccess entries when content
  is created or deleted.
* Adds get_access_ids_for_request() helper method for use in views.
* Adds tests.

* test: can't import content.search in lms tests

* feat: use SearchAccess in documents and views

* Adds an access_id field to the document, which stores the
  SearchAccess.id for the block's context.
* Use the requesting user's allowed access_ids to filter search results
  to documents with those access_ids.
* Since some users have a lot of individual access granted, limit the
  number of access_ids in the filter to a large number (1_000)
* Updates tests to demonstrate.

* test: can't import content.search or content_staging in lms tests

* fix: make access_id field filterable

* fix: use SearchAccess.get_or_create in signal handlers

In theory, we shouldn't have to do this, because the CREATE and DELETE
events should keep the SearchAccess table up-to-date.

But in practice, signals can be missed (or in tests, they may be
disabled). So we assume that it's ok to re-use a SearchAccess.id created
for a given course or library context_key.

* refactor: refactors the view tests to make them clearer

Uses helper methods and decorators to wrap the settings and patches used
by multiple view tests.

* feat: adds org filters to meilisearch filter

* Uses content_tagging.rules.get_user_orgs to fetch the user's
  content-related orgs for use in the meilisearch filter.
* Limits the number of orgs used to 1_000 to keep token size down

* refactor: removes data migration

Users should use the reindex_studio management command to populate SearchAccess.

* refactor: adds functions to common.djangoapps.student.role_helpers

to allow general access to the user's RoleCache without having to access
private attributes of User or RoleCache.

Related changes:

* Moves some functionality from openedx.core.djangoapps.enrollments.data.get_user_roles
  to this new helper method.
* Use these new helper method in content_tagging.rules

* fix: get_access_ids_for_request only returns individual access

instead of all course keys that the user can read.

Org- and GlobalStaff access checks will handle the rest.

* fix: use org-level permissions when generating search filter

Also refactors tests to demonstrate this change for OrgStaff and
OrgInstructor users.

* refactor: remove SearchAccess creation signal handlers

Lets SearchAccess entries be created on demand during search indexing.

* feat: omit access_ids from the search filter that are covered by the user's org roles

---------

Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
2024-04-17 11:21:34 -07:00
MueezKhan246
e187d70233 Merge branch 'master' of https://github.com/openedx/edx-platform into MueezKhan/Remove-ENABLE_USER_ID_SCOPE-Flag-From-Platform 2024-04-17 09:54:41 +00:00
MueezKhan246
86c49f7dce test: removed redundant test case 2024-04-17 09:50:31 +00:00
Saad Yousaf
6dd5157fee fix: fix cadence value for instant cadence and update version 2024-04-17 14:16:50 +05:00
MueezKhan246
726392b1fa feat: removed ENABLE_USER_ID_SCOPE flag from validator 2024-04-17 03:53:07 +00:00
Troy Sankey
f30ae71c23 feat: add more verbose logging around force_enrollment
After testing the enterprise bulk enrollment flow with
force_enrollment=True, I'm finding that the enrollment is still not
forced. This extra logging will hopefully help shed light on where this
boolean might be accidentally ignored.
2024-04-15 08:21:35 -07:00
Saad Yousaf
0270809808 feat: add email cadence setting in notification preferences for emails 2024-04-15 17:04:56 +05:00
Kyle D. McCormick
5fe131c858 fix: --theme-dirs argument to compile_sass management command
This fixes the ability to pass custom theme directories to
the management command which compiles site themes, a la:

   ./manage.py lms compile_sass --theme-dirs /my/custom/themes/dir

The exception, which was due to a incompatible use of @lru_cache, was:

   File "openedx/core/djangoapps/theming/management/commands/compile_sass.py",
   line 93, in parse_arguments:
     available_themes.update({t.theme_dir_name: t for t in get_themes([theme_dir])})
   TypeError: unhashable type: 'list'

This has been broken since the @lru_cache decorator was added, but it
wasn't noticed because:

* We weren't compiling any comprehensive themes in CI.
* Tutor supports compehensive theming, but not *site theming*, so
  it doesn't use this management command at all
  (site themeing == comp theming * site configuration).
* Although edx.org executes this management command, it does not provide
  use the `--theme-dirs` argument, so the bug was not hit.
2024-04-12 11:33:31 -04:00
Taras Lytvynenko
14777af1d2 Lytvynenko/changed link parsing (#33565)
* fix:  Social link parsing approach changed

* feat: fix tests

* fix: tests

---------

Co-authored-by: Edward Zarecor <ezarecor@tcril.org>
2024-04-10 17:38:57 -04:00
Chris Chávez
ddb407a3f2 feat: handle tags when importing/exporting courses (#34356) 2024-04-08 11:39:46 -07:00
Ben Lu
54eeedf3a4 Merge pull request #34400 from openedx/add-JWT-kid-for-verification-when-use-asymmetric-key
feat: add kid when encoding and signing JWT with asymmetric key
2024-04-08 12:53:49 -05:00
Irtaza Akram
a1f08d85bd Merge pull request #34398 from openedx/xblock2
upgrade xblock==2.0
References:
- https://github.com/openedx/public-engineering/issues/15
- https://github.com/openedx/XBlock/pull/680
2024-04-08 14:30:38 +05:00
Kyle D. McCormick
24db4dfb53 build: compile/watch sass with new npm scripts
`paver` commands are deprecated for managing static assets. Starting in
Sumac, only `npm run` commands will be supported for managing static
assets.

To ease the transition, both `paver` and `npm run` commands will work in
Redwood. However, we want to stop using the *implementations* of the
`paver` asset commands right now, as they are blocking the Python 3.11
upgrade. This will also make the removal of `paver` commands more
straightforward come Sumac.

So, this commit turns these commands/functions:
* paver compile_sass (used by configuration)
* paver watch_sass (used by configuration and devstack)
* pavelib/assets.py:_compile_sass (used by Tutor)

into very thin wrappers around the new `npm run` commands. Each of these
paver routines now raise a loud deprecation warning, including a message
of the `npm run` command that the operator can switch to.
We expect no impact to site operators or end users.

https://github.com/openedx/edx-platform/issues/31895
2024-04-04 10:31:02 -04:00
Muhammad Adeel Tajamul
fe13884ed6 feat: added management command to delete notifications (#34447)
* feat: added management command to delete notifications
2024-04-04 16:57:26 +05:00
Dmytro
03a490f7cd feat: add ability to notify credentials about honor certificates (#32633) 2024-04-04 07:56:02 -04:00
Ben Lu
6112f85c0b fixup! feat: add JWT KID 2024-04-03 13:22:51 -05:00
Ben Lu
ef59da6775 feat: add JWT KID
Added JWT KID when encoding and signing JWT with asymmetrical key
2024-04-03 12:13:53 -05:00
Irtaza Akram
79a4327f67 Merge branch 'master' into xblock2 2024-04-03 14:57:00 +05:00
Jillian
7ad225658f feat: don't use OLX for tags when copying/duplicating blocks (#34386) 2024-04-02 09:59:57 -07:00
Irtaza Akram
3faa773bb9 feat: add support for xblock 2 2024-04-01 16:02:06 +05:00