Commit Graph

6342 Commits

Author SHA1 Message Date
Ahtisham Shahid
75d8448ef5 refactor: Moved ProgramDiscussion/Live Configuration Models to program's app (#29871)
refactor: Moved ProgramDiscussion/Live Configuration Models to program's app
2022-02-09 15:43:22 +05:00
Michael Terry
6ac9bae571 Merge pull request #29117 from openedx/mikix/drop-learning-sequence-flag
feat: enable using learning sequence outlines by default
2022-02-07 11:32:59 -05:00
Tim McCormack
a1b09c0b8d fix: More resilience when calling encrypt_for_log with missing key (#29878)
It's likely that someone will at some point enable encrypted logging but
forget to deploy the config change that sets the key; if this happens, we
should gracefully return a warning rather than raise an exception.

Along the same lines, make sure that safe-sessions won't raise an exception
if the setting is missing, and document the suggested use of getattr.
2022-02-07 16:00:56 +00:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Julia Eskew
a6a27104cd feat: Add organization-level waffle flag overrides to the view consumed
to make the toggle report spreadsheet. Add appropriate tests.
2022-02-04 12:31:09 -05:00
Tim McCormack
95ad20afde test: Small cleanups in SafeSessions code (#29868)
- test: Remove reference to `REDIRECT_TO_LOGIN_ON_SAFE_SESSION_AUTH_FAILURE`,
  since it was removed in commit bd7653aefcd77a/PR #29132.
- docs: Clarify what "work correctly" means for header-logging
2022-02-04 14:43:41 +00:00
AsadAzam
e2bb15cda8 fix: added admin only config in available providers (#29865)
* fix: added admin only config in available providers

* fix: fixed tests
2022-02-04 15:32:43 +05:00
Rebecca Graber
47aed8d2ab feat: management command for consuming kafka events (#29838) 2022-02-03 12:39:31 -05:00
Tim McCormack
7c7792f92a fix: Delete JWTs and other cookies when SafeSessions deletes session cookie (#29857)
This is more correct and may reduce the likelihood of perpetuating a bad
mixed-auth state.

In general, we should probably be modifying session and JWT cookies in
sync at all times, never individually. This specific code probably won't
make anything worse, but a clean reset might improve user experience in
the rare cases where someone somehow gets their browser into a weird
state.

- Switch from `response.set_cookie` with past expiry to just using the
  `response.delete_cookie` method.
- Docstring improvements.

ref: ARCHBOM-2030 (internal)
2022-02-03 15:00:23 +00:00
Simon Chen
1f36b35bc4 fix: remove the data point on zoom since edx_zoom is deprecated (#29860)
Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
2022-02-02 13:53:06 -05:00
Kshitij Sobti
23be63309b feat: Add a new user API for discussions (#29287)
Adds a new user API for discussion that returns the discussion stats across the course.
2022-02-01 17:51:01 +05:00
Nathan Sprenkle
1212e3550c feat: ora staff grader backend (#29828)
- Adds Enhanced Staff Grader (ESG) backend-for-frontend (BFF) in `lms/djangoapps/ora_staff_grader`
    - Adds routing to ESG BFF at `{lms_url}/api/ora_staff_grader/*`
    - Adds mock implementation routing at `{lms_url}/api/ora_staff_grader/mock/*`
    - Adds `ORA_GRADING_MICROFRONTEND_URL` setting for routing to ESG microfrontend (MFE)
- Updates to the teams app:
    - Add`get_teams_in_teamset` to the teams API.
    - Add `get_team_names` to teams service.
- Adds `openassessment.staffgrader` app for appropriate ORA migrations.
- Modifies management commands for creation of users.
- Updates test factory to return display org with course overview.

Co-authored-by: jansenk <jkantor@edx.org>
Co-authored-by: Leangseu Kim <lkim@edx.org>
Co-authored-by: Ben Warzeski <bwarzeski@edx.org>
2022-01-31 11:09:41 -05:00
Kshitij Sobti
16881afcad feat: Allow fetching details of inactive providers [BD-38] (#29656)
* feat: Allow fetching details of inactive providers

* squash!: update tests add docs

* squash!: review feedback

* squash!: fix quality issue

* squash!: review feedback
2022-01-31 15:58:27 +05:00
Kshitij Sobti
2758301c31 feat: Discussion Topics API v2 [BD-38] [TNL-9332] [BB-5189] (#29530)
* feat: New API for discussion topics

Creates a new API for discussion topics that uses auto-crated discussion topic links for the new discussion provider.

* squash!: refresh migration
2022-01-31 15:57:49 +05:00
Michael Terry
500f87945c Merge pull request #29842 from openedx/mikix/respect-course-start-when-resetting-schedule
fix: avoid resetting a learner schedule to before a course starts
2022-01-28 15:13:46 -05:00
Michael Terry
656ec5def9 fix: avoid resetting a learner schedule to before a course starts
If a learner changes modes (like upgrades to a verified learner),
we will reset their schedule for them. But if they did this before
the course started, we would accidentally set their schedule to
the current time. So when the course did start, they would already
appear to be behind schedule.

That's silly. So now we always look at course start time when
resetting the learner's schedule.

AA-426
2022-01-28 14:58:36 -05:00
Jeremy Ristau
c04e63d271 Merge pull request #29796 from open-craft/chris/FAL-2728
feat: InvalidKeyError message changed to NotFound 404 message
2022-01-28 10:29:13 -05:00
Julia Eskew
0eb0f99d00 feat: Add org-level waffle overrides to allow a waffle flag to be overridden for all
courses in a particular organization, without needing to make a separate course-level
waffle override for each individual course for an organization.
2022-01-28 08:00:18 -05:00
AsadAzam
7c1710beca feat: made all lti providers admin only config (#29835) 2022-01-28 13:46:46 +05:00
XnpioChV
726842b39a feat: InvalidKeyError message changed to NotFound 404 message 2022-01-26 19:28:14 -05:00
Felipe Montoya
c807af628f Merge pull request #29449 from eduNEXT/MJG/1st_filters_batch
[BD-32] feat: add first batch of Open edX Filters
2022-01-26 11:35:00 -05:00
Maria Grimaldi
f29a4eef68 feat: add first batch of Open edX Filters
* Add PreEnrollmentFilter
* Add PreRegisterFilter
* Add PreLoginFilter
2022-01-26 11:45:44 -04:00
Peter Pinch
4f58ed4f25 Merge pull request #29260 from open-craft/jill/BD-13-sandbox
[BD-13] refactor: deprecates ModuleSystem properties related to code sandboxing
2022-01-26 09:57:41 -05:00
Awais Qureshi
5b8cc00964 test: Fixed test failures due to randomization. (#29822)
* test: Fixed test failures due to randomization.
2022-01-26 19:48:55 +05:00
Usama Sadiq
59a0acc768 Revert "feat!: Remove django-admin default login. (#29416)" (#29824)
This reverts commit be2a57902f.
2022-01-26 19:17:45 +05:00
Awais Qureshi
be2a57902f feat!: Remove django-admin default login. (#29416)
Now redirect the admin-login towards the lms login.
BOM-2855
2022-01-26 17:27:17 +05:00
Attiya Ishaque
60f3623066 fix: [VAN-823] Remove Authn MFE Waffle Flag (#29778) 2022-01-26 16:02:53 +05:00
Michael Terry
299cd981e5 feat: enable using learning sequence outlines by default
This drops the learning_sequences.use_for_outlines waffle flag,
enabling using learning sequence outlines unconditionally.

(Note that Learning sequences still don't support legacy keys.)

AA-1040
2022-01-25 12:40:29 -05:00
Tim McCormack
ddc55483da Merge pull request #29768 from openedx/timmc/strict-by-default
feat: Enable ENFORCE_SAFE_SESSIONS by default
2022-01-25 17:19:11 +00:00
Awais Qureshi
c66498db36 test: Fixed test failures due to randomization. (#29816)
* test: Fixed test failures due to randomization.
2022-01-25 22:13:57 +05:00
Tim McCormack
9827a077aa feat: Enable ENFORCE_SAFE_SESSIONS by default; improve docs
This toggle has been shown to work, so enable by default. Will need to be
documented in release notes for deployers.
2022-01-25 16:03:54 +00:00
Tim McCormack
4624bb7c3e fix: Prevent SafeSessions false alarm in course outline alt-masquerading
The course outline view has a way for a staff user to make a request as if
they are another user, not just by using the masquerade mechanism but also
by setting a request parameter. This can result in false positives in the
safe-sessions middleware, and if `ENFORCE_SAFE_SESSIONS` is enabled the
responses will be 401 errors.

The fix here is to do the same thing that masquerading does in setting a
`real_user` property on the new user object, which the safe-sessions
middleware then undoes (restoring the request.user) before determing
whether there's a mismatch.

(Without this fix, enabling `ENFORCE_SAFE_SESSIONS` also causes some tests
in `test_views.py` to fail.)
2022-01-25 16:03:54 +00:00
Tim McCormack
e6536d0d0e test: Stop sharing API client between users in unit tests
Using the same Client or APIClient instance for multiple users, where
one user has an active session and the other is making an
Authorization header call, results in a Safe Sessions violation.

By using separate clients for different test users, we avoid this
violation, allowing `ENFORCE_SAFE_SESSIONS` to be enabled by default.
2022-01-25 16:03:54 +00:00
Tim McCormack
7fc20e69f4 feat: Allow safe-session exemption even for exceptions
Change `mark_user_change_as_expected` to no longer take the response object
and instead convey the expected-change information via RequestCache.
This requires edx-django-utils 4.4.2, which fixes the bug where
RequestCache was cleared in the exception phase.

Also, no longer mark `ENFORCE_SAFE_SESSIONS` toggle as
temporary. We'll want it as an opt-out.

I was tempted to take this opportunity to move any existing
`mark_user_change_as_expected` calls to be closer to where the actual
change request.user occurs, reducing risk of both false positives and false
negatives, but it would be better to do that one at a time in case a move
breaks something. (Ideally it would be called right after any
`django.contrib.auth` `login` or `logout` call; previously, we were
constrained by having to make the call after a response object had been
created.) These changes can be made later if it becomes necessary.
2022-01-25 16:03:54 +00:00
Dillon Dumesnil
a3c65012af Merge pull request #29818 from openedx/ddumesnil/fix-discount-override-aa-1191
fix: Include course key when checking enabled for COURSEWARE_MFE_MILE…
2022-01-25 06:44:48 -08:00
Dillon Dumesnil
e05122a437 fix: Include course key when checking enabled for COURSEWARE_MFE_MILESTONES_STREAK_DISCOUNT
AA-1191
2022-01-25 09:21:10 -05:00
Jillian Vogel
2173a98ef8 refactor: deprecates ModuleSystem properties for code sandboxing and cache
* Deprecates ModuleSystem can_execute_unsafe_code, get_python_lib_zip and cache properties
* Adds a new CacheService and SandboxService to provide the deprecated property
* Adds tests for the added CacheService and SandboxService
* Updates the ModuleSystemShim tests in Lms and Studio
2022-01-25 14:42:39 +10:30
Michael Terry
44e799f60d fix: don't show broken enroll link for staff on invite courses
Non-enrolled staff users were being shown enroll links for courses
that you can't self-enroll for (masters-only, invitation-only, etc).

This fixes the outline page to ignore staff status for that check.

AA-1164
2022-01-24 16:14:14 -05:00
Awais Ansari
62b7db64bc chore: update lti providers video link (#29802) 2022-01-21 20:00:24 +05:00
Ahtisham Shahid
e63fb2e01a feat: Created API for programs live page zoom lti (#29763)
* feat: Created API for programs live page zoom lti

* refactor: Merged similar code by inheritance

* refactor: removed duplicates and resolved tight coupling issues

* refactor: Decoupled views
2022-01-21 12:26:47 +05:00
Jillian Vogel
ef8f841ac2 temp: let XBlock API users optionally use LabXchange block types
when fetching block metadata and rendering blocks while maintaining the
original usage IDs/OLX.

This change is marked temporary because LabXchange need it during the
transition to a custom runtime, but it's not really useful to anyone
else. We will revert this change with a future PR.
2022-01-20 10:35:59 +10:30
Bianca Severino
e848935000 fix: exclude masters from honor code check 2022-01-19 15:11:41 -05:00
Sarina Canelake
bebe1e9a6b Merge pull request #29775 from jramnai/fix-coursegraph-readme
docs: nit for CourseGraph README file
2022-01-19 13:12:19 -05:00
Long Lin
9514cb5732 feat: add enterprise course enrollments data to enrollments for support 2022-01-19 10:14:13 -05:00
Kshitij Sobti
d5c9d61a98 feat: Allow fetching details of inactive providers (#29511) 2022-01-19 11:18:16 +05:00
Dillon Dumesnil
e458c7eb36 Merge pull request #29747 from openedx/ddumesnil/goal-celly-modal-aa-1138
feat: AA-1138: Adds ability to have Weekly Goal Celebration Modal in MFE

Adds celebrate_weekly_goal to the CourseEnrollmentCelebration and includes logic
for only returning True if the db field is true and the learner has hit their goal
this week. Adds ability to set to false via the API already used by the frontend.
Default db value is False, but all new enrollments after merge will be set to True.
2022-01-18 06:13:43 -08:00
Kshitij Sobti
2bbf447ab5 feat: banner for staff users that displays a message for testing the new MFE experience (#29698)
Adds a new banner allowing staff users to preview and switch between the new and legacy forum experience.
2022-01-18 11:18:59 +05:00
Jayram Nai
d942c91b01 docs: nit for coursegraph README file 2022-01-17 19:41:11 +05:30
Attiya Ishaque
bf46daa494 Merge pull request #236 from edx/attiya/VAN-817
fix: Add security fix in LMS logout redirect_url.
2022-01-17 14:27:01 +05:00
Dillon Dumesnil
7b1fead04c feat: AA-1138: Adds ability to have Weekly Goal Celebration Modal in MFE
Adds celebrate_weekly_goal to the CourseEnrollmentCelebration and includes logic
for only returning True if the db field is true and the learner has hit their goal
this week. Adds ability to set to false via the API already used by the frontend.
Default db value is False, but all new enrollments after merge will be set to True.
2022-01-14 13:59:22 -05:00