Commit Graph

1084 Commits

Author SHA1 Message Date
Eemaan Amir
e5f7a027e4 feat: added a new field to canvas_entry_properties in enrollment email (#36603)
* feat: added a new field to canvas_entry_properties in enrollment email

* test: updated test files
2025-04-25 17:27:49 +05:00
Feanil Patel
d423775012 test: Replace calls to reverse('courseware')
We want to remove this page and URL endpoint so we're removing all the
references in the code that might point to this page.  It was replaced
by the sequences page in the Learning MFE years ago but the old pages
were never cleaned up. We are replacing the calls with the URL for the
courseware in the learning MFE.

See https://github.com/openedx/edx-platform/issues/35803 for more
details.
2025-04-04 14:01:19 -04:00
Deborah Kaplan
896ca99c79 chore: calling other djangoapps from API instead of model (#36448)
switching  from calling other djangoapps via direct model access to
calling from API. This included  adding an API in the Student app.

FIXES: APER-3972
2025-03-28 12:14:21 -04:00
Muhammad Faraz Maqsood
591008280f chore: rename braze_client to email_client 2025-03-26 11:21:56 +05:00
Muhammad Faraz Maqsood
2b83fe3bf4 Revert "chore: rename braze_client to email_client"
This reverts commit b3f9903a4b.
2025-03-25 17:38:32 +05:00
Muhammad Faraz Maqsood
b3f9903a4b chore: rename braze_client to email_client 2025-03-25 10:31:32 +05:00
Deborah Kaplan
29de9b2dc4 feat!: Legacy account, profile, order history removal (#36219)
* feat!: Legacy account, profile, order history removal

This removes the legacy account and profile applications, and the order
history page. This is primarily a reapplication of #31893, which was
rolled back due to prior blockers.

FIXES: APER-3884
FIXES: openedx/public-engineering#71


Co-authored-by: Muhammad Abdullah Waheed <42172960+abdullahwaheed@users.noreply.github.com>
Co-authored-by: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com>
2025-02-10 14:39:13 -05:00
Usama Sadiq
1a16073ad0 fix: enable pylint warnings (#36196) 2025-02-03 14:18:11 +05:00
Irtaza Akram
ec2a698604 cleanup references of python 2 & <3.11 (#35799)
* chore: cleanup of old python references
2024-11-15 16:58:20 +05:00
Andrey Cañon
c370028bbd feat: modify PhoneNumberSerializer regex to allow plus symbol at the … (#35117)
* feat: modify PhoneNumberSerializer regex to allow plus symbol at the beginning
* chore: update PhonenumberSerializer docstring
2024-07-17 09:08:44 -04:00
Glib Glugovskiy
0153086b61 fix: add edit permissions for limited staff only in LMS 2024-06-17 10:00:39 -04:00
Jesper Hodge
e95d7e7e32 fix: libraries performance problem
This is an attempt to fix a performance problem on the libraries home page. When you go to studio home and click on the libraries tab, on prod it will be quick for admins but extremely slow for course instructors (> 12 seconds) and leads to timeouts. It grows with the number of libraries that are assigned to the instructor.

The Python code for the request to load libraries for a particular user goes through all existing libraries and then checks all of the user's roles for each library, which results in a complexity of O(l*r), l=libraries, r=roles. This PR improves the complexity to O(l).

The BulkRoleCache and RoleCache classes were using a python set to store all roles for a particular user. A user can have a large number of roles, and lookup speed of iterating through a set is slow (O(n)). Most roles don't have the same course id, however. So if you have the course id of the role you're looking for, we can use a dict of course ids that contain related roles. The number of roles per course id is negligible, so we arrive at a lookup speed of O(1) when looking up a user's roles that belong to a specific course id.

The BulkRoleCache now caches and stores user roles in a data structure like this:
    {
        user_id_1: {
            course_id_1: {role1, role2, role3},  # Set of roles associated with course_id_1
            course_id_2: {role4, role5, role6},  # Set of roles associated with course_id_2
            [ROLE_CACHE_UNGROUPED_ROLES_KEY]: {role7, role8}  # Set of roles not tied to any specific course or library. For example, Global Staff roles.
        },
        user_id_2: { ... }  # Similar structure for another user
    }

While this changes the data structure used to store roles under the hood and adds the new property `roles_by_course_id` to the RoleCache,
when initializing the RoleCache will store roles additionally in the previous data structure - as a flat set - in the `_roles` property accessible via `all_roles_set`. This establishes
backwards compatibility.

We are now storing roles twice in the RoleCache (in each of the two data structures), which means this takes twice as much memory, but only in the scope of a request.
2024-05-20 16:34:08 -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
Zachary Hancock
2f2ed4d6cb feat: send course role events to the event bus (#34158)
Notify the event bus when a user's role in a course is added or removed
2024-02-13 13:16:23 -05:00
Nathan Sprenkle
7037c8d27b feat: remove rollout percentage code for learner home (#34198)
This code allowed us to control rollout but is no longer needed.
2024-02-07 15:27:57 +00:00
Syed Sajjad Hussain Shah
cb2a34e51f feat: logout other sessions on email change (#33846)
* feat: logout other sessions on email change

* fix: updated the approach for session invalidation

* fix: update and add tests

* fix: update tests with descriptive comments

* feat: add integration tests

* fix: store email in session update

* fix: add setting for tests

* fix: fix tests

* feat: Upgrade Python dependency edx-drf-extensions (#34135)

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

Co-authored-by: syedsajjadkazmii <syedsajjadkazmii@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: syedsajjadkazmii <syedsajjadkazmii@users.noreply.github.com>
2024-01-29 14:43:51 +05:00
Justin Hynes
426ee163bc revert: add brand_color variable for the email templates (#33421)"
This reverts commit 4ec70eb98b.

This commit introduced a new setting (`brand_color`) that does not appear to be set and is causing issues with account deletion and other parts of the courseware.

Reverting until we can understand the change better.
2024-01-24 18:47:02 +00:00
bydawen
4ec70eb98b feat: add brand_color variable for the email templates (#33421)
* feat: add brand_color variable for the email templates

* test: fix tests assertations

---------

Co-authored-by: Eugene Dyudyunov <evgen.dyudyunov@raccoongang.com>
2024-01-23 13:21:06 +05:00
Kshitij Sobti
f494586b84 feat: Add toggle to allow redirecting to courseware after enrollment.
This change adds a new waffle switch to redirect a student to coursware after
enrolment instead of the dashboard.
2023-11-09 15:38:11 +01:00
Rebecca Graber
ddabba458b feat: remove manual sends of events (#33642) 2023-11-03 10:36:50 -04:00
Muhammad Abdullah Waheed
caf8e456e2 Revert "feat: Account and profile MFE legacy removal - redeployment (#31893)" (#33542)
This reverts commit 08f5e7e563.
2023-10-19 12:26:29 +05:00
Muhammad Abdullah Waheed
08f5e7e563 feat: Account and profile MFE legacy removal - redeployment (#31893)
feat: Account and profile MFE legacy removal - redeployment

* Revert "Revert "FC-0001: Account pages -> micro-frontend (#30336)" (#31888)"

This reverts commit 90c4ca6e47.

* refactor: removed filters test from user_api accounts

---------

Co-authored-by: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com>
2023-10-19 10:43:15 +05:00
Feanil Patel
7202c22e1d Merge pull request #33373 from openedx/feanil/update_password_length_default
feat: Update the minimum password length.
2023-10-17 10:08:15 -04:00
0x29a
febcccc147 fix: limited staff cohorts and gradebook access
Limited Staff should not have studio read access by design.

However, since many LMS views depend on the `has_course_author_access` check and `course_author_access_required`
decorator, we have to allow write access until the permissions become more granular. For example, there should
be STUDIO_VIEW_COHORTS and STUDIO_EDIT_COHORTS specifically for the cohorts endpoint, which is used to display
"Cohorts" instructor dashboard tab.
2023-10-16 22:06:09 +02:00
Feanil Patel
64e91d4080 test: Update to an even longer password. 2023-10-12 10:31:13 -04:00
Feanil Patel
1e2ea85372 test: Update more tests that had short passwords. 2023-10-10 16:36:26 -04:00
Feanil Patel
ae42b094ea test: Fix validation tests.
Make them resilient to the default changing where it makes sense.
2023-10-02 14:10:03 -04:00
Cristhian Garcia
4a9aed44e5 feat: emit log in / out tracking logs (#33219) 2023-09-19 11:03:34 -04:00
Sagirov Evgeniy
c5d1807c81 feat!: remove most Old Mongo functionality (#31134)
This commit leaves behind just enough Old Mongo (DraftModulestore)
functionality to allow read-only access to static assets and the
root CourseBlock. It removes:

* create/update operations
* child/parent traversal
* inheritance related code

It also removes or converts tests for this functionality.

The ability to read from the root CourseBlock was maintained for
backwards compatibility, since top-level course settings are often
stored here, and this is used by various parts of the codebase,
like displaying dashboards and re-building CourseOverview models.

Any attempt to read the contents of a course by getting the
CourseBlock's children will return an empty list (i.e. it will look
empty).

This commit does _not_ delete content on MongoDB or run any sort of
data migration or cleanup.
2023-09-06 10:01:31 -04:00
Kira Miller
776f4bf94e feat: adding unenrollments to event bus (#33085)
* feat: adding unenrollments to event bus

* fix: quality fixes

* fix: tweaks to pass tests

* fix: more tweaks for testing

---------

Co-authored-by: John Nagro <jnagro@edx.org>
2023-08-28 09:08:49 -06:00
Usama Sadiq
7710e60328 fix: fix middleware get_response parameter deprecation warning (#33067) 2023-08-22 15:52:30 +05:00
Agrendalath
e746986820 feat: create Course Limited Staff role
This is an experimental approach to introduce a role which has all Course Staff
permissions, except for the Studio access.

Co-authored-by: 0x29a <demid@opencraft.com>
2023-07-21 15:09:41 +02:00
Braden MacDonald
9b9b88df52 chore: remove some usages of six (Python2 compat) (#32554)
* get rid of six.text_type(s)
* get rid of six.b()
* get rid of six.string_types
* get rid of six.PY2/six.PY3
* get rid of six.iteritems() and six.viewvalues()
2023-07-17 12:18:43 -07:00
Zainab Amir
fa7953ca24 feat: set traverse pagination to False (#32269)
* For enrollment email task, while getting course uuid and
owner data don't traverse the discovery endpoint.
* Update log message
2023-05-19 19:46:33 +05:00
Muhammad Abdullah Waheed
90c4ca6e47 Revert "FC-0001: Account pages -> micro-frontend (#30336)" (#31888)
This reverts commit 0f02c7b3d9.
2023-03-07 17:41:56 -05:00
Sagirov Evgeniy
0f02c7b3d9 FC-0001: Account pages -> micro-frontend (#30336)
* feat: Account pages. Learner Profile page

* feat: Account pages. Account Settings page

* feat: Account pages. Removed unused styles

* feat: Account pages. Removed unused toggles

* feat: fixed tests and pylint errors

* feat: update redirect to account settings for student_dashboard

* feat: fix pylint errors
2023-03-07 17:41:52 +05:00
Shahbaz Shabbir
cf27d344bd fix: Add longer retry schedule for course enrollment emails (#31854) 2023-03-06 10:44:38 +05:00
Ned Batchelder
12765a7a59 refactor(test): use @skip_unless_lms uniformly 2023-02-01 13:52:26 -08:00
Nathan Sprenkle
f783dce52d feat: Learner Home experimental rollout (#31642)
* feat: add experimental redirect for Learner Home

As a request by Data, this system repeatably groups users into
experiment groups. Based on end of user ID, users that fall beneath a
threshold (LEARNER_HOME_MFE_REDIRECT_PERCENTAGE) will be redirected to
the Learner Home experience, if enabled. Otherwise, learners will see
the legacy dashboard.

* feat: add learner home redirect percentage setting

Adds LEARNER_HOME_MFE_REDIRECT_PERCENTAGE to common settings to avoid a
failed lookup. Can be overridden through config.

* refactor: change test to not leak implementation
2023-01-25 10:59:39 -05:00
Arunmozhi
d417a7561f refactor: rename ItemFactory to BlockFactory 2023-01-23 14:47:47 +01:00
shahbaz-arbisoft
4797f2f1c8 fix: Update enrollment email for master track learners 2023-01-16 15:33:53 +05:00
Demid
21424bba2f test: fix hardcoded date of birth (2022) (#31488) 2023-01-03 10:07:17 -05:00
0x29a
83396ffb07 refactor: convert course_module term to course_block 2022-12-19 17:48:49 +01:00
0x29a
cf47f6385f refactor: xmodule/error_module.py -> xmodule/error_block.py 2022-12-19 17:48:49 +01:00
Bernard Szabo
89086d482a feat: TNL-10136 fix build errors
blank lines in __init__
private method that needed to be public
importlib and importlib-resources dependencies
2022-12-13 17:19:41 -05:00
Bernard Szabo
377edc2f4d feat: TNL-10136 Propagate changes from last PR 2022-12-13 17:19:41 -05:00
Bernard Szabo
d5a5e25fef feat: TNL-10136 fix lint errors
And import cross-references
And wrap-around lines
2022-12-13 17:19:40 -05:00
Bernard Szabo
2d544f94be feat: TNL-10136 tease course enrollment from student model
Reapply changes developed in bszabo/TNL-10136-student-course-enrollment branch to current master
2022-12-13 17:19:34 -05:00
Kaustav Banerjee
99cd4a4715 feat: disable allowed enrollment if enrollment closed 2022-12-13 15:49:25 +01:00
Mubbshar Anwar
3941fa5083 fix: hide course dates block (#31335)
If course is archived hide the course dates block from email..

VAN-1176
2022-11-24 23:29:12 +05:00