Commit Graph

2674 Commits

Author SHA1 Message Date
Eemaan Amir
8c8a567dd0 feat: added batching to managemnet command to avoid queueing errors (#36720)
* feat: added batching to managemnet command to avoid queueing errors

* fix: refactored code to fix pylint errors

* fix: fixed quality check errors

* fix: fixed quality check errors
2025-05-15 17:02:37 +05:00
Eemaan Amir
8758007e9b feat: management command to backfill is_disabled attribute to segment (#36680)
* feat: management command to backfill is_disabled attribute to segment

* fix: fixed pylint errors

* fix: replaced broad exceptions with specific exceptions
2025-05-09 18:54:46 +05:00
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
Bryann Valderrama
f90e59e52a docs: add event_type inline code annotation for open edX events (#36355) 2025-03-14 09:55:50 +01: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
Usama Sadiq
b6828cecaa fix: enable pylint warnings (#36195)
* fix: enable pylint warnings
2025-01-30 17:15:33 +05:00
Felipe Montoya
9acdfe6fd2 feat: show exception message from filters in the user interface (#35407) 2025-01-09 18:22:56 +01:00
0x29a
ac9861fd73 feat: add has_course_author_access to CourseHomeMetadataView response 2024-11-29 00:39:58 +05:30
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
Brian Mesick
e478975105 chore: Add missing PII annotations, update safelist
PII Annotations are very out of date, this commit adds most that were
missing in edx-platform, and some additional annotations to the
safelist. It is not comprehensive, several other upstream Open edX
packages also need to be updated. It also does not include removing
annotations that have been moved upstream, or been removed entirely.
Those are separate follow-on tasks.
2024-11-05 12:58:36 -05:00
Deborah Kaplan
8c923bea24 feat!: removes deprecated v1 certificate behavior (#35562)
* feat!: removes deprecated v1 certificate behavior

this removes the long-deprecated v1  certificate behavior. This removes
the old-style date selection behavior  (ie., not a choice between
*Immediately upon passing*, *End date of course*, *A date after the course
end date*), which is no longer reliably maintained or supported in
Studio or Credentials.

FIXES: #35399
2024-10-02 12:06:57 -04:00
Awais Ansari
1fb20b3598 feat: update account verification email context (#35165) 2024-07-24 14:40:58 +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
Kyrylo Kireiev
53174178f3 feat: [FC-0047] Extend mobile API with course progress and primary courses on dashboard view (#34848)
* feat: [AXM-24] Update structure for course enrollments API (#2515)
---------
Co-authored-by: Glib Glugovskiy <glib.glugovskiy@raccoongang.com>

* feat: [AXM-53] add assertions for primary course (#2522)
---------
Co-authored-by: monteri <36768631+monteri@users.noreply.github.com>

* feat: [AXM-297] Add progress to assignments in BlocksInfoInCourseView API (#2546)
---------
Co-authored-by: NiedielnitsevIvan <81557788+NiedielnitsevIvan@users.noreply.github.com>
Co-authored-by: Glib Glugovskiy <glib.glugovskiy@raccoongang.com>
Co-authored-by: monteri <36768631+monteri@users.noreply.github.com>
2024-07-10 20:07:41 +05:00
Glib Glugovskiy
0153086b61 fix: add edit permissions for limited staff only in LMS 2024-06-17 10:00:39 -04:00
MushtaqRossier
ead0468965 Merge pull request #34941 from openedx/mrossier/SONIC-529
feat: Added some extra logs
2024-06-07 13:43:02 +02:00
Attiya Ishaque
0cb2db14a2 fix: add auto_generated_username flag in activation email (#34931) 2024-06-07 15:52:45 +05:00
Mushtaq Rossier
e8a85320ab feat: Added some extra logs 2024-06-07 09:57:22 +02:00
Mushtaq Rossier
eb2b51d02e feat: Added extra info logs for refundable method 2024-06-05 12:40:01 +02:00
sohailfatima
17f48adb49 feat: remove unnecessary PII 2024-06-04 12:08:52 +05:00
sohailfatima
8e7a5f18c7 feat: added tracking events for password reset initiation 2024-06-04 12:08:52 +05: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
Glenn R. Martin
20c8fc127b fix: logging emission of REFUND_ORDER 2024-05-17 11:55:47 -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
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
Zainab Amir
383f5d636a feat: update account verification email context (#34294) 2024-02-27 03:20:15 -08:00
Attiya Ishaque
3a05fd20c6 refactor: Remove unused code for merchandising 2U LOBs (#34230) 2024-02-20 14:03:10 +05:00
Mubbshar Anwar
9fd5157577 fix: update activation email (#34136)
update account activation email message copy in body

VAN-1800
2024-02-20 11:48:50 +05:00
Attiya Ishaque
16e0333da9 refactor: remove the managment command populate user emails on braze (#34228) 2024-02-14 17:54:34 +05: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
Zainab Amir
c233327ea0 feat: remove unused recommendations code (#33960) 2023-12-20 16:56:39 +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
Andy Shultz
ad90c05b98 fix: remove unused and untested function 2023-10-26 11:00:37 -04:00
Andy Shultz
2fde582a4d docs: remove TODO which asks a question where the answer is no
TODO posits cache key is not in use, it is used in this file via signal.
2023-10-26 11:00:27 -04:00
Andy Shultz
fadc9618d4 docs: fix old course_id arg description to modern(2015) usage
the code asserts that this is a key rather than a string
2023-10-26 10:59:30 -04:00
Andy Shultz
c3a24c126e fix: rename update cache functions to what they are 2023-10-20 10:19:42 -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