Commit Graph

9460 Commits

Author SHA1 Message Date
David Ormsbee
2c77ac6bcb fix: don't bubble up empty partition groups from units.
In dfb80acc1, we allowed group_access settings to bubble up from
Units to Sequences in the case where all Units had the same group
settings for a particular user partition. This caused an issue
where the group being bubbled up could be empty if the Unit was
misconfigured in OLX (this is already caught if done directly on
the Sequence). This commit fixes things so that empty partition
group settings never bubble up.

We don't want empty partition groups to bubble up because it would
mean that no groups are allowed to access the Sequence, which is
probably an error. (There is a separate visible_to_staff_only flag
when you want to hide content from all non-staff users.)
2021-04-29 18:16:09 -04:00
David Ormsbee
dfb80acc11 feat: Enrollment Tracks OutlineProcessor (MST-685)
NOTE: This will require a forced backfill of course outlines to update
the course content data in learning_sequences:

  python manage.py cms backfill_course_outlines --force

Without this backfill, the learning_sequences API will continue to serve
stale content data that has no user partition group data. It won't cause
errors, but it won't do the exclusions properly.

Commit summary:

* Created EnrollmentTrackPartitionGroupsOutlineProcessor to process the
  enrollment_track User Partition Group, allowing Sequences and Sections
  to be removed based on their group_access settings.
* Added user_partition_groups attribute to CourseLearningSequenceData
  and CourseSectionData in learning_sequences/data.py, along with
  backing model data.
* get_outline_from_modulestore now extracts group_access settings from
  Sections and Sequences. It also bubbles up group_access settings from
  Units, meaning that if a Sequence with no group_access setting has
  Units that are all set to show only to the Verified enrollment track,
  then the Sequence will only show to the Verified enrollment track.

This commit adds model-level support for all user partition groups by
capturing all the content group associations (group_access), but it only
implements the code checks for the enrollment track partition. It's not
clear that we want to generalize, since there's only one other partition
type (A/B testing) that is applicable at the outline level.

It's important to note that there is no way to set the group_access for
a Section or Sequence in Studio today. It's only possible by direct
editing of the OLX for import. That being said, the block structures
framework supports applying course groups at this level, and this commit
moves learning_sequences closer to feature parity.

The bubbling up from Units to the parent Sequence was done to mitigate
confusion when a Sequence is entirely composed of Units that are not
visible to the user because of content group restrictions. It's not
clear whether this is something we want to do in the long term, since it
would simplify the code to always specify group_access at the Sequence
level. This first pass is done partially to collect better data about
places in our courses where this kind of usage is already happening.

Most of the EnrollmentTrackPartitionGroupsOutlineProcessor code and its
tests were written by @schenedx.
2021-04-28 12:58:59 -04:00
Matt Hughes
637405aecf [fix]: studio display of ungraded subs.s w/useless due dates
By "useless" due dates I'm specifically talking about due dates which
are erroneously set in the course strucutre, but which don't matter
because the entire course is self-paced, rather than instructor-paced.

JIRA:EDUCATOR-5713
2021-04-27 10:02:07 -04:00
Usama Sadiq
588f11b100 refactor: apply lint-amnesty to pylint violations 2021-04-27 14:43:31 +05:00
alangsto
50d57a64bb MST-757 Move exam registration to async task (#27398)
Synchronously registering proctored exams while saving content to studio is causing a significant slow down. The function that registers the exams has been moved to an async task. In addition, a signal handler on_course_publish has also been moved to the async task, as it relies on exam registration being complete before being executed.
2021-04-26 12:04:04 -04:00
Julia Eskew
4462ed37b2 Revert "update login api" (#27416)
This PR might be causing e2e tests to fail. Reverting and merging without waiting on tests.
2021-04-26 10:07:36 -04:00
uzairr
5103f59df9 upgrade login api
Modify the existing login api in a way that
it will allow the user to login via username as well.
currently it is only allowing email to log the user in.

VAN-445
2021-04-23 17:21:18 +05:00
Ali Akbar
025fb5ed66 Merge pull request #228 from edx/aakbar/xss-security-fixes
Fix XSS for numerous files
2021-04-22 01:16:47 +05:00
Awais Jibran
e05d4a9c47 Monitor error in NR when OLX validation fails. (#27381) 2021-04-21 11:56:54 +05:00
Usama Sadiq
ab41a7daee refactor: Apply lint-amnesty on pylint violations 2021-04-20 21:43:59 +05:00
Awais Jibran
62c8805e3e Refactor + Tests: Course Import Feature (#27369)
* Code Refactoring
This PR bumps code coverage by adding unit tests & clean up some code for improving code quality and maintainability.
2021-04-19 23:49:42 +05:00
Felipe Montoya
313eef2fad Merge pull request #27339 from eduNEXT/lmm/fix_server_error_page
fix: Import missing function in server_error template.
2021-04-16 12:45:00 -05:00
Awais Jibran
9722e37492 Enable Course Olx Validation during Course Import (#27300)
* Enable import failure and email with Errors/Warnings

This PR enables course import failure in case of olx validation errors. Here is the flow.
  * Course Import tries to import foo.tar.gz into their course shell
  * Course olx contains validation errors
  * During course import, olx is validated and import is failed with the error message "Course olx validation failed. Please check your email."
  * System generates an email with ERRORs & WARNINGs in the body of the email.

This PR also adds a waffle flag contentstore.bypass_olx_failure. The purpose of this test flag is to allow course teams to unblock by enabling them to bypass the
the olx-validation failure.
The workaround is shared on the ticket TNL8214.

* Disable olx validation out of the box.
2021-04-16 18:45:59 +05:00
Ali-D-Akbar
a4437cb786 refactor: fix xss PROD-2301 2021-04-16 15:29:38 +05:00
Ali-D-Akbar
70bda87669 refactor: fix xss PROD-2300 2021-04-16 14:10:07 +05:00
Awais Jibran
8acb45f687 Fix index bug in the email (#27353)
* Fix indexing bug in the email.
2021-04-16 11:04:28 +05:00
Régis Behmo
e58ad6c809 fix: extra ")}" in 500 error page
The 500 page included ugly ")}" characters.
2021-04-15 17:40:46 -04:00
Ahtisham Shahid
71beccc12c Updated User task email (#27346) 2021-04-15 22:38:47 +05:00
Ahtisham Shahid
58231c4262 Moved Import error messages to single place (#27331) 2021-04-15 12:25:04 +05:00
Luis Moreno
275d9f077e fix: Import missing function in server_error template. 2021-04-14 11:54:05 -04:00
Julia Eskew
7dbad0bd9a learning_sequence doc tweaks and new type annotation style (#27311)
* docs: Add a statement comment. Update learning sequences README.

* refactor: Add Python3.6+-style type annotations to attrs classes where possible.
2021-04-14 11:12:01 -04:00
stvn
22fb1ec124 refactor: Move InstructorFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
8869a30bcd refactor: Move UserFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
2fa36fb0cf refactor: Move StaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
5dd8302d8b refactor: Move GlobalStaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
43698fff0a refactor: Move get_course_by_id helper from LMS to core
This helper is used by the LMS, CMS, _and_ `openedx.core`,
so let's move it to `openedx.core` to reduce import complexity.

The following files no longer import from LMS:
- cms/djangoapps/contentstore/management/commands/edit_course_tabs.py
- lms/djangoapps/ccx/migrations/0006_set_display_name_as_override.py
- openedx/core/djangoapps/ccxcon/api.py
- openedx/core/djangoapps/verified_track_content/models.py
- openedx/features/course_experience/plugins.py

Note: The LTI XBlock has a dependency on this import path (!?);
a fix can be found here [1].

- [1] https://github.com/edx/xblock-lti-consumer/pull/154
2021-04-13 23:25:48 -07:00
Kyle McCormick
4531e15519 refactor!: stop using import_shims
Attempting to import packages from
lms/djangoapps, cms/djangoapps, or common/djangoapps
as if they are import roots will now
simply raise ImportErrors (like any other invalid
import) instead of DeprecatedEdxPlatformImportError.

See docs/decisions/0007-sys-path-modification-removal.rst
for more details.
2021-04-12 09:43:59 -04:00
Awais Jibran
30c80082c3 Use config settings for olxcleaner (#27294)
* Use config settings for olxcleaner

Use config settings instead of hardcoded values for olx validation. This would help in adding a great deal of control when you want to change these settings in the future. With this approch we would not need a redeploy.

* Use configs and deprecate waffleflag and also add / update tests
2021-04-12 16:27:42 +05:00
Uzair Rasheed
488069f0cf Merge pull request #27292 from edx/add-separate-ratelimit-var
Add independent ratelimit setting for forms
2021-04-10 14:46:53 +05:00
Feanil Patel
16e4aa3c62 chore: Remove decentralized devstack config.
We have decided not to pursue the decentralized devstack design right
now and so we want to cleanup files and task that were built as a part
of the process.

Related Ticket: ARCHBOM-1685
2021-04-09 15:50:03 -04:00
uzairr
1d5a95facb Add independent ratelimit setting for forms
Currently, login and registration forms and view to log the user in
are sharing same ratelimit settings which is causing too much noise
while rendering forms.This PR will introduce a separate
setting for logistration forms.

VAN-436
2021-04-09 21:10:08 +05:00
Saad Yousaf
b36c562887 Merge pull request #27287 from edx/saad/TNL-8051
[TNL-8051] - bump olxcleaner version with latest update.
2021-04-09 15:45:58 +05:00
Jawayria
f1bb1b9161 Merge pull request #26482 from edx/jawayria/bom-2350
BOM-2350: Removed unused imports from cms using 'unimport'
2021-04-09 12:56:57 +05:00
SaadYousaf
7242b5018a [TNL-8051] - bump olxcleaner version with latest update. 2021-04-08 23:46:50 +05:00
HamzaIbnFarooq
582c02afc4 feat!: remove sysadmin dashboard feature w.r.t 0002-deprecate-sysadmin-dashboard-adr.rst
The sysadmin dashboard feature is converted into a plugable app named edx-sysadmin (https://github.com/mitodl/edx-sysadmin) according to the decisison made at https://github.com/edx/edx-platform/blob/master/lms/djangoapps/dashboard/decisions/0002-deprecate-sysadmin-dashboard-adr.rst. Instances using sysadmin dashboard should use the new plugin from now onwards.

BREAKING CHANGE: sysadmin dashboard is removed
2021-04-08 09:15:11 -04:00
Awais Jibran
1d39e431e3 Use allowed_xblocks settings (#27265)
* Use allowed_xblocks in olxcleaner validate.
2021-04-07 15:45:04 +05:00
Ahtisham Shahid
f3a62b5f89 Error message for proctor exam show to user (#27238)
* Error message for proctor exam visible to user

* Created exception class for Invalid Proctor settings
2021-04-07 10:46:19 +05:00
Jawayria
772f8cbe90 refactor: Removed unused imports
Removed unused imports from cms using 'unimport'
2021-04-06 17:47:48 +05: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
David Ormsbee
d2389fb7fb fix: Don't break export when transcript is Latin-1 encoded.
Video SJSON transcripts are supposed to be UTF-8 encoded, but SJSON
is an ad hoc thing we made up to make it easier to build the
transcripts viewer in the VideoBlock, and it's not well specified.
Prior to this commit, if you had an SJSON file with Latin-1 encoded
text outside the standard ASCII range (e.g. û), then we'd error out
while trying to export it.

This was blocking an effort to export some Old Mongo courses (TNL-8007).
2021-04-02 13:33:16 -04:00
Awais Jibran
2641336fc1 Update error message (#27232) 2021-04-02 22:05:59 +05:00
Nathan Sprenkle
c97932fa99 fix: add missing protocol to web link for assets (#27220)
* fix: add missing protocol to web link for assets

* test: fix asset path test

* refactor: update asset web URL to use urljoin
2021-04-02 11:13:57 -04:00
AsadAzam
c4da6c1fe4 Display import errors to user (#27147)
* Display import errors to user

* Refactored

* Refactored

* Refactored

* Fixed quality

* Fixed quality

* Refactored code

* Fixed message

* Refactored code
2021-04-02 18:53:39 +05:00
Awais Jibran
8023bbc1af Log Errors + Warnings. (#27210) 2021-04-02 16:02:46 +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
Awais Jibran
f898fc5d72 Short circuit, library import. (#27195) 2021-04-01 12:29:57 +05:00
Awais Jibran
ad7f6019fe Integrate "olxcleaner" with course import (#27164)
* Integrating olxcleaner in course import

* Adding toggle removal date and addressing pylint issues.
2021-03-31 13:26:14 +05:00
alangsto
736e399cde MST-643 prevent errors for escalation email if proctoring is disabled (#27166) 2021-03-30 08:33:48 -04:00
Zainab Amir
8cc5f13daf Add rate limit to registration endpoint (#27060)
Currently the registration endpoint has no rate limit. Added a new ratelimit
variable to support the change, it's value is set to 60/7d.

VAN-302
2021-03-25 16:28:30 +05:00
AsadAzam
9bf96765cc display error during import upload (#27128) 2021-03-25 12:54:18 +05:00