Commit Graph

5649 Commits

Author SHA1 Message Date
Pooja Kulkarni
86bfcea19c feat: Django app to allow user retirement via API (#25800)
This adds a new django app to allow the GDPR user retirement via
Open edX's REST API. Prior to this the only way to trigger the user
retirement was either by the user themself clicking "Delete my account"
in the account setting page or via creating a User Retirement request
by admin. With these changes, the user retirement process can be
triggered using REST API.
2021-04-08 13:50:12 -04:00
stvn
67e045b5e0 refactor: Move discussions api LTI serialization logic 2021-04-08 09:31:48 -07:00
stvn
442a8a52cd Merge PR #27279 bd03/api/type-hints
* Commits:
  style: Add more typehints to discussions API
2021-04-08 09:27:20 -07:00
Usama Sadiq
068ac5290f refactor: Ran pyupgrade on openedx/core
Ran pyupgrade on openedx/core/{lib, tests}
2021-04-08 18:34:38 +05:00
Usama Sadiq
8de47ef51f refactor: Ran pyupgrade on openedx/core
Ran pyupgrade on openedx/core/{djangolib, lib}
2021-04-08 18:34:24 +05:00
Usama Sadiq
6a79d47589 refactor: Ran pyupgrade on openedx/{testing, tests} 2021-04-08 14:49:40 +05:00
Usama Sadiq
04b3949683 refactor: Ran pyupgrade on openedx/core/djangoapps
Ran pyupgrade on openedx/core/djangoapps/{video_config, video_pipeline, waffle_utils}
2021-04-08 14:36:34 +05:00
stvn
862ba01208 style: Add more typehints to discussions API 2021-04-07 21:05:33 -07:00
stvn
2053da2a9e fix: Update default provider returned by discussions API 2021-04-07 11:54:21 -07:00
stvn
d884967e2c refactor: Split kwargs out to individual lines
to make further addition/deletion cleaner.
2021-04-07 11:43:12 -07:00
stvn
83c93973b0 Merge PR #27188 bd03/api/post
* Commits:
  feat: Implement POST endpoint for discussions API
  feat: Implement update helper for discussions API
  feat: Implement to_internal_value helper for discussion API
  feat: Add lti_configuration to discussions API payload
  refactor: Base discussions serializer off of ModelSerializer
  refactor: Remove unused helper from discussions API
  fix: Use the correct name for serializer to_internal_value
2021-04-07 11:32:18 -07:00
stvn
6eabae0d9e feat: Implement POST endpoint for discussions API 2021-04-07 10:48:59 -07:00
stvn
87e375d627 feat: Implement update helper for discussions API 2021-04-07 10:48:59 -07:00
stvn
342d922034 feat: Implement to_internal_value helper for discussion API 2021-04-07 10:48:59 -07:00
stvn
def644b9aa feat: Add lti_configuration to discussions API payload 2021-04-07 10:48:59 -07:00
stvn
0cce315539 refactor: Base discussions serializer off of ModelSerializer
to make Django operations easier.
2021-04-07 10:48:59 -07:00
stvn
3f6f6e3667 refactor: Remove unused helper from discussions API 2021-04-07 10:48:56 -07:00
stvn
e8163c9161 fix: Use the correct name for serializer to_internal_value
Fortunately, this wasn't being used yet.
2021-04-07 10:48:08 -07:00
Kyle McCormick
19ba691e33 refactor: clean up some courseware URL handling docs & tests
Based on Julia's code review.
2021-04-07 10:24:58 -04:00
Kyle McCormick
a69567b18b feat: default staff to courseware MFE if active (via jump_to)
The /jump_to/ LMS endpoint is used in a number of places
to direct users to courseware. It currently only redirects to
Legacy courseware URLs, which then conditionally may
redirect to the Learning MFE.

Two issues with this:
1. Performance Impact: In most cases, going to Legacy first
   is just an extra redirect.
2. Confusion for Privileged Users: Neither course nor global
   staff are auto-redirected from the Legacy experience to the
   MFE. Thus, these priviliged users confusingly never see the
   MFE by default; they must always manually click into it.

This commit makes it so that /jump_to/ directs
users to whatever the default courseware experience is
for them. For staff of courses active in the new experience,
this will impact (at a minimum) the "View Live"
links in Studio, all links on the old and new LMS
course outline, and the "Resume" links on the course
dashboard. Learners should see no difference other than
a performance improvement when following courseware links
from the LMS.

This also adds an optional 'experience=[legacy|new]'
query param to /jump_to/, allowing us to specifically
generate Legacy courseware URLs for the
"View in Legacy Experience" tool.

TNL-7796
2021-04-07 10:24:58 -04:00
Usama Sadiq
25b275bca4 refactor: Ran pyupgrade on openedx/core/djangoapps
Ran pyupgrade on openedx/core/djangoapps/{xblock, xmodule_django, zendesk_proxy}
2021-04-07 18:57:52 +05:00
Usama Sadiq
ac8c3b6a03 refactor: Ran pyupgrade on openedx/core/djangoapps
Ran pyupgrade on openedx/core/djangoapps/{util, verified_track_content}
2021-04-07 18:57:12 +05:00
Usama Sadiq
d540688f8e refactor: Ran pyupgrade on openedx/core/djangoapps/user_authn 2021-04-07 18:54:33 +05:00
Piotr Surowiec
bc1e9afe4b feat: allow overriding unit icons (#21433)
This:
1. Introduces a new override using the `pluggable_override` decorator.
It is now possible to specify a custom way of getting XBlock's icon
by defining `GET_UNIT_ICON_IMPL` in settings.
2. Introduces a way to add custom `XBLOCK_MIXINS` by defining
`XBLOCK_EXTRA_MIXINS` in settings. This allows, e.g. to add
new fields to XBlocks.
2021-04-07 09:42:12 -04:00
Muhammad Ammar
9d7e804236 Merge pull request #27255 from edx/ammar/update-cache-key-for-dsc
update cache key for DSC
2021-04-07 15:27:42 +05:00
Jawayria
cf81718b10 Merge pull request #26601 from edx/jawayria/bom-2408-4
BOM-2408: Remove unused imports from openedx/core/djangoapps/{dark_la…
2021-04-07 12:56:37 +05:00
Jawayria
a4744dfde1 Merge pull request #26600 from edx/jawayria/bom-2408-3
BOM-2408: Removed unused imports from openedx/core/djangoapps/{conten…
2021-04-07 12:56:20 +05:00
Zaman Afzal
194f29ca55 ENT4134 Add the support for multiple IDPs (#27073)
* ENT4134 Add the support for multiple IDPs
2021-04-06 23:27:20 +05:00
Robert Raposa
280f8e1577 docs: improve CourseWaffleFlag admin docs
Improve the docs for how to configure CourseWaffleFlag
overrides via Django admin.

ARCHBOM-1721
2021-04-06 11:05:44 -04:00
muhammad-ammar
3929d098b6 update cache key for dsc 2021-04-06 17:34:42 +05:00
Jawayria
8fc7333982 Refactor: Remove unused imports
Removed unused imports from openedx/core/djangoapps/{dark_lang, django_comment_common, embargo, lang_pref, oauth_dispatch, plugins, programs, schedules}
2021-04-06 17:11:59 +05:00
Jawayria
df06d1312d refactor: Removed unused imports
Removed unused imports from openedx/core/djangoapps/{content_libraries, coursegraph,courseware_api, crawlers, credentials, credit}
2021-04-06 17:07:13 +05:00
Usama Sadiq
91ea53da56 refactor: Ran pyupgrade on openedx/core/djangoapps/user_api 2021-04-06 12:50:48 +05:00
Usama Sadiq
c14eab1332 refactor: Ran pyupgrade on openedx/core/djangoapps/site_configuration 2021-04-06 12:50:34 +05:00
Usama Sadiq
ebcf204d60 refactor: ran pyupgrade on openedx/core/djangoapps
ran pyupgrade on openedx/core/djangoapps/{schedules, self_paced, service_status}
2021-04-06 12:50:11 +05:00
Simon Chen
1d186b34bf MST-734 Fix production issue on Learner Onboarding Status Panel (#27248)
* MST-734 Fix production issue on Learner Onboarding Status Panel
Fix the prod issue where learning sequence service object missing the needed get_user_course_outline service API
The user web API call currently returns 500
2021-04-05 16:54:58 -04:00
Robert Raposa
96be45f1bd Merge pull request #27222 from edx/robrap/ARCHBOM-1721-toggle-doc-cleanup
ARCHBOM-1721: docs: update toggle docs
2021-04-05 10:47:55 -04:00
Feanil Patel
9f4a8e6724 Merge pull request #27233 from edx/feanil/flag_management
feat!: Replace logging WaffleSwitch with a django settinge.
2021-04-02 15:12:11 -04:00
Feanil Patel
ba4d98898e Merge pull request #27231 from edx/feanil/more_safe_sessions_updates
fix: Reduce safe-sessions false alarms.
2021-04-02 14:45:22 -04:00
Feanil Patel
8e7144ae2e revert: "test: Update query counts."
This reverts commit c2eabf6cca.

We are changing this from a waffle setting to a django setting so we can
undo this query count bump.
2021-04-02 14:42:55 -04:00
Feanil Patel
455033458c feat!: Replace logging WaffleSwitch with a django settinge.
This was initially introduced as a temporary flag to be able to get more
information.  But if we get this kind of issue again, we'll need
something like this logging to determine the source of the session
collision.  Rather than removing the code and adding it back in later,
convert this temporary switch into an opt-in setting that can be used
again in the future.

BREAKING_CHANGE: 'safe_session.log_request_user_changes' switch no
longer exists and is replaced with the 'LOG_REQUEST_USER_CHANGES' django
setting which defaults to 'False'
2021-04-02 14:20:07 -04:00
Feanil Patel
c45ffd7509 test: Test login redirects prefer session cookies.
Add a test to ensure that the login page redirect as long as we have a
valid session even if we have expired on non-existent JWT cookies.
2021-04-02 14:19:10 -04:00
Feanil Patel
118f095110 fix: Assume logged in if user has a valid session.
Previously they also had to have a valid JWT cookie which led to a weird
corner case where a user was logged in but still showed the login form
resulting in some confusion and odd behavior.

This change gives precedence to the session token to determine whether
or not someone is logged into the LMS but ensures that if you go through
the login flow, you refresh your JWT cookies. This should not cause any
breakage for MFE flows that might redirect to the LMS login page since
the JWT would get refreshed if it's out of date but the session is
valid.
2021-04-02 14:19:10 -04:00
Feanil Patel
23f2b758d4 fix: Print more stack frames on requset tracing.
Six frames was not enough because for DRF views the request gets wrapped
in a proxy object and so we need more of the stack to see what part of
the code we're in that actually invokes the use change.
2021-04-02 14:19:07 -04:00
Jawayria
de2a28bd82 Merge pull request #26598 from edx/jawayria/bom-2408-1
BOM-2408: Removed unused imports from openedx/core/djangoapps/{api_ad…
2021-04-02 19:38:00 +05:00
Ben Holt
ec3c31eb05 feat: added another 'Date' expose-headers for outline api clients (#27221)
Exposed the Date header on the outline api so clients can accurately compute times relative to the dates returned by the API; this was previously done with the course API (#26979)

Browser time is notoriously unreliable for this, especially for a Learner-facing countdown call-to-action based on the access expiration date. (REV-2126)

Using the Date header for this allows the client to make use of information that is already sent, does not require additional calls nor modifying the API, and could be generalized to more or all our APIs without modifying them.
2021-04-02 10:37:19 -04:00
Jawayria
55b692aede refactor: Removed unused imports
Removed unused imports from openedx/core/djangoapps/{api_admin, catalog, ccxcon, certificates}
2021-04-02 18:28:16 +05:00
Robert Raposa
8ef8b35a54 docs: update toggle docs
A variety of updates were made to improve the toggle documentation:
* Added comments to help ensure that the waffle(), waffle_switches(),
  waffle_flags() anti-pattern won't be contagious (copied).
* Some minor toggle_description updates.
* Removed empty toggle_target_removal_date annotations for
  non-temporary toggles.
* Removed empty optional toggle_warnings annotations.
* Removed empty optional toggle_tickets annotations.
* Removed deprecated toggle_category, toggle_status,
  and toggle_expiration_date annotations.
* Fixed some indents, use cases, and implementations.

ARCHBOM-1721
2021-04-01 21:58:29 -04:00
Feanil Patel
5b7caf45d6 fix: Don't log warnings on logout.
When a user logs out, there are warnings logged right now because the
session user_id mismatches(it becomes None on logout).  Previously we
would log the request mismatch on debug and the session mismatch as
normal.

This change will result in us logging nothing if the session change is
not abnormal.
2021-04-01 16:42:21 -04:00
M. Zulqarnain
072b6b8875 Revert "chore: Unpin python-dateutil (#27196)" (#27217)
This reverts commit 40878cd554.
2021-04-01 23:32:51 +05:00