Commit Graph

7419 Commits

Author SHA1 Message Date
Michael Terry
29159891c3 feat: send course access error along to course home MFE
We previously only sent it to the courseware MFE. Also unify the
naming of this access error to 'course_access' in courseware and
course home APIs.
2021-07-23 14:01:58 -04:00
Usama Sadiq
1795008686 fix: Removed pylint constraint (#28222)
Disabled pylint warnings in pylint_tweaks
2021-07-23 18:35:57 +05:00
Tim McCormack
503e3d1d37 test: Fix safe_sessions comments and add pinning test (#28249)
Add pinning test for SafeCookieData values, and update SafeSessions
middleware comments to match code.

Main comment changes:

- Fix description of cookie structure:
    - Specify hash algorithm (SHA256, not "H")
    - Don't try to describe internals of TimestampSigner; description was
      incorrect in several ways: Did not include string delimiters under
      base64 (there's JSON in there); did not include the actual MAC
      portion. Just describe general effect and shape of output.
    - Add missing trailing pipe delimiter in signed data hash input
- Use phrase "intermediate key" rather than the less familiar term "usage
  key"
2021-07-22 21:09:32 +00:00
Matt Tuchfarber
325629dd25 Merge pull request #28237 from edx/tuchfarber/move_may_certify_2
Move cert display decisions to certificates app
2021-07-22 10:20:13 -04:00
Dillon Dumesnil
f886ced838 Merge pull request #28233 from edx/ddumesnil/hide-content-after-due-progress-aa-912
fix: AA-912: Hide URL after due date if subsection is marked as hide …
2021-07-22 07:17:35 -07:00
Dillon Dumesnil
7dd4f2db99 fix: AA-912: Hide URL after due date if subsection is marked as hide after due
A bug was reported of a learner accessing content that should have been hidden
due to the hide after due setting in Studio by the course team by clicking on
the Progress tab. This takes into account that value and will now hide the URL
on the Progress tab in that scenario.
2021-07-21 17:53:23 -04:00
Binod Pant
33cdf634b4 refactor: Extract core functionality of enrollment api in a python api to avoid REST calls from edx-enterprise (#28202)
* feat: Refactor out non REST portions of enrollment api from enrollment POST method

For use with edx-enterprise to avoid making REST calls for bulk enrollment and other use cases

ENT-4746

* feat: Remove unused test

Testing is covered by test_views

* refactor: isort

isort fixes

* docs: ADR for why this change

ADR

ENT-4746

* test: Fix test failure by restoring course_id to correct object

* test: Test fix

* refactor: pylint fixes

* refactor: raise from to avoid pylint error

* refactor: Start to work toward a util in enterprise_support instead of refactoring this endpoint

* feat: Add util function in enterprise_support to eventually handle enrollment, only used by bulk enrollment for now

* feat: One more revised idea, this time low risk in edx platform and also helps address enterprise specific flow. testing pending

* feat: syntax and unused constant

* feat: Restore view and add new util function to use in edx-enterprise instead

* feat: breakpoint

* unused import

* feat: don't fail on existing enrollment

* docs: ADR update

* docs: docstring minor update

* test: unit test add_user_to_course_cohort

* refactor: imports

* feat: remove unused error classes

* refactor: lint

* test: Test cases

* test: Two more tests for negative cases

* feat: missing init.py file

* test: Fix tests to use correct user mock

* unused import

* refactor: Review feedback, test fixes, needs rebase now

* feat: rebase changes

* feat: keep audit_log with similar logic as in the view

* refactor: Review feedback, test constant usage
2021-07-21 16:59:45 -04:00
Matt Tuchfarber
d16c9a804c refactor: Move cert code to cert app
The `may_certify` function is used to determine whether a learner should
be able to see that their certificate is ready. It is therefore entirely
in the certificates domain. This remove may_certifiy and
may_certify_for_course from the xmodule and course_overview
apps and into the certificates app. The xmodule may_certify was not called
outside of tests prior to this, and the other's were easily moved.

In order to avoid circular imports, this also moved
certificate_info_for_user out of the model code and into an API
2021-07-21 15:56:19 -04:00
Bianca Severino
14c85d9465 feat: pass verified name flag into user api 2021-07-20 16:58:39 -04:00
Michael Terry
e81fcbf5d7 Merge pull request #27879 from open-craft/mtyaka/FAL-1938-support-learning-mfe-on-subpath
Support Learning MFE hosted on subpath.
2021-07-20 13:16:38 -04:00
Bianca Severino
430f1554b4 Revert "feat: pass verified name flag into account settings"
This reverts commit 85dc8c8d67.
2021-07-19 12:06:33 -04:00
David Ormsbee
46f42a1512 perf: reduce calls to get_course_by_id
CoursewareMeta alredy initializes self.course, so there's no need to
separately call get_course_by_id for various attributes. This was
resulting in separate modulestore fetches that would pull down the
structure document and re-do all the expensive top-level course queries
in modulestore.
2021-07-19 11:30:41 -04:00
Bianca Severino
85dc8c8d67 feat: pass verified name flag into account settings 2021-07-19 11:03:24 -04:00
Waheed Ahmed
e203309019 feat: increment lockout counter upon NonCompliantPasswordException (#28218)
Increment lockout counter upon `NonCompliantPasswordException` to prevent further
login attempts after 6 attempts and also to prevent further reset password emails.

Reports from some users receiving 100s of password emails, upon investigation seems
like their password is not compliant with edX and has been compromised.

VAN-192
2021-07-19 18:34:36 +05:00
Zia Fazal
6f6a9e9c0b Merge pull request #27762 from edly-io/ERTE-5
[ERTE-5] feat: Added enterprise uuid in event context for enterprise enrolment events
2021-07-19 10:43:43 +05:00
João Cabrita
7261bc42bd feat: Add legacy_link field to TextBook app
This implements the `legacy_link` method to the TextbooksCourseApp
and makes the `legacy_link` URL absolute in the API response.

Related tickets:
* [TNL-8438](https://openedx.atlassian.net/browse/TNL-8438)
* [BB-4416 (OpenCraft Internal)](https://tasks.opencraft.com/browse/BB-4416)
2021-07-16 19:34:13 +05:00
Dillon Dumesnil
33ccd05df0 Merge pull request #28195 from edx/ddumesnil/update-shift-dates-logic-aa-856
fix: AA-856: update shift dates logic to ignore missed_deadlines
2021-07-16 05:56:00 -07:00
Dillon Dumesnil
3863bdb93b fix: update shift dates logic to ignore missed_deadlines
We ignore the missed_deadlines because this endpoint is used in the Learning MFE for
learners who have remaining attempts on a problem and reset their due dates in order to
submit additional attempts. This can apply for 'completed' (submitted) content that would
not be marked as past_due
2021-07-15 14:20:18 -06:00
Kyle McCormick
caf75dc0d9 feat: allow course staff to view outlines as students
This adds support for course staff masquerading as any other user when
viewing their own course, via user={username} querystring parameter.

Rules:
* Anonymous users are repesented by a blank "user" value.
* If there is no "user" parameter at all, render for the user making the
  request.
* Global staff can view any course as any user.
* Course staff and instructors can view their own course as any user
  (including other staff, the anonymous user, or users not enrolled in
  their course).

This commit supports TNL-8330 (switching the frontend-app-learning MFE
to use the Learning Sequences API instead if Course Blocks).
2021-07-15 13:18:44 -04:00
Awais Qureshi
88b35ba9a9 Merge pull request #28183 from edx/removing-python_2_unicode_compatible
Django3 has removed python_2_unicode_compatible.
2021-07-15 17:55:45 +05:00
Awais Qureshi
695f5dab7a Merge pull request #28184 from edx/removing-python_2_unicode_compatible-2
Django3 has removed python_2_unicode_compatible.
2021-07-15 16:56:42 +05:00
Awais Qureshi
251fcaa586 Django3 has removed python_2_unicode_compatible.
Execute the codemodes on this file and removed all usage.
2021-07-15 12:28:06 +05:00
Awais Qureshi
cfe81cd834 Django3 has removed python_2_unicode_compatible.
Execute the codemodes on this file and removed all usage.
2021-07-15 00:37:15 +05:00
Awais Qureshi
0433af537f Django3 has removed python_2_unicode_compatible.
Execute the codemodes on this file and removed all usage.
2021-07-15 00:26:09 +05:00
Mehak Nasir
79181b3db0 fix:link fix for the yellowdig general documentation 2021-07-14 22:54:09 +05:00
Sofia Yoon
e343c78227 feat: basic prototype for custom pacing pls in studio (AA-883) 2021-07-13 13:56:28 -04:00
Justin Hynes
d786f6d394 Merge pull request #28168 from edx/jhynes/microba-1289_overviews-continued
refactor: Remove use of CourseOverview model directly in the Certificates app
2021-07-13 12:40:59 -04:00
Waheed Ahmed
74e3b664eb fix: clean accent characters from username (#28157)
Also cleaned username for Authn MFE while registering using SSO/SAML.

VAN-483
2021-07-13 20:33:22 +05:00
Julia Eskew
a68bfe28b9 fix: Use a "through" model for the ManyToManyField fields in CourseSection
and CourseSectionSequence to ensure that cascading deletes will occur to delete
the relation upon deletion of a foreign-keyed object.

This commit is phase 3 of 4 in order to ensure a smooth deploy. The phases:
1) Add separate through models for user partition groups, add fields to point to the
   separate models, and start writing to those fields as well. (COMPLETE)
2) After all models have been re-generated, switch code over to use separate through
   model fields backed by the separate through models *and* stop writing to the original
   ManyToManyField field. (COMPLETE)
3) After phase 2 is deployed smoothly, remove the original ManyToManyField fields. (This PR!)
4) After phase 3 is deployed smoothly, rename the new fields to have the same name
   as the old fields, so new_user_partition_groups -> user_partition_groups.

This PR is designed to be able to easily be rolled-back if anything goes wrong.
2021-07-13 11:04:51 -04:00
Justin Hynes
bbda7384f8 refactor: Remove use of CourseOverview model directly in the Certificates app
[MICROBA-1289]
* Remove use of the CourseOverview model directly in the Certificates app
* Introduce a few new Python API functions in the `course_overview` and `catalog` django apps to replace functionality in the Certificates app.
2021-07-13 10:26:39 -04:00
Justin Hynes
9f5b9ba915 Merge pull request #28129 from edx/jhynes/microba-1289_overviews
refactor!: remove the `get_course_overview` function in favor of `get_course_overview_or_none`
2021-07-13 07:59:49 -04:00
Diana Huang
9173707a50 feat: Allow shared cookies' domains to be set separately. (#28135)
Several of our cookies are meant to be shared between the LMS
and the marketing site. The previous assumption was that
SESSION_COOKIE_DOMAIN would cover both. We would like to make
it so that these can be set independently of each other.

https://openedx.atlassian.net/browse/ARCHBOM-1831
2021-07-12 15:49:11 -04:00
Julia Eskew
31deebcba1 fix: Use a "through" model for the ManyToManyField fields in CourseSection
and CourseSectionSequence to ensure that cascading deletes will occur to delete
the relation upon deletion of a foreign-keyed object.

This commit is phase 2 of 3 in order to ensure a smooth deploy. The phases:
1) Add separate through models for user partition groups, add fields to point to the
   separate models, and start writing to those fields as well. (COMPLETE)
2) After all models have been re-generated, switch code over to use separate through
   model fields backed by the separate through models *and* stop writing to the original
   ManyToManyField field. (This PR!)
3) After phase 2 is deployed smoothly, remove the original ManyToManyField fields
   and rename the new fields to have the same name as the old fields.

This PR is designed to be able to easily be rolled-back if anything goes wrong.
2021-07-12 14:03:11 -04:00
Manjinder Singh
1a026c5e15 refactor: noop migration for testing (#28150)
This is a noop migration for testing changes
to the deployment pipeline.

This is a copy of: #28078
2021-07-12 11:44:38 -04:00
Julia Eskew
b24e65903d Revert "feat: AA-883 Basic prototype for self paced due dates in Studio" 2021-07-09 17:38:18 -04:00
Justin Hynes
725793a8f9 refactor!: remove get_course_overview function in favor of get_course_overview_or_none
[MICROBA-1289]
* Remove `get_course_overview` function in favor of `get_course_overview_or_none`
2021-07-09 10:14:07 -04:00
sofiayoon
264606dfd4 Merge pull request #28016 from edx/syoon/AA-844
feat: AA-883 Basic prototype for self paced due dates in Studio
2021-07-09 09:23:05 -04:00
Julia Eskew
b5205c5d9f fix: Add a data migration which removes any existing duplicates in the learning sequences
Django app's user partition group model.
fix: Add a unique constraint on that same model on partition_id/group_id to avoid
future duplicates.

TNL-8314
2021-07-09 09:20:50 -04:00
Kshitij Sobti
666a50d298 feat: allow optionally passing PII in course LTI tab (#26982) 2021-07-09 18:13:42 +05:00
João Cabrita
530e4932bb fix!: Disable changing discussions providers once a course run has started
For authenticated users that are not global staff, changing discussion
providers after a course has started fails with 403 Forbidden.

Related issues:
* [BB-4253](https://tasks.opencraft.com/browse/BB-4253)
* [TNL-8142](https://openedx.atlassian.net/browse/TNL-8142)

BREAKING CHANGE:
Course staff, who were previously allowed to do this operation,
will instead receive a 403 Forbidden response.
2021-07-09 12:14:23 +05:00
Sofia Yoon
09eb36e550 feat: AA-883 basic prototype for custom pacing pls in studio
fix: make new field in xblock json serializable and don't assign due dates to ORAs

feat: display warning message in Studio if the relative date input is more than 18 weeks for custom pacing in self paced course

fix: handle due dates for mix of ORA and non ORA problems under a subsection and other styling fixes

feat: add a minimum restriction for self paced courses due date editor input

fix: naming of warning id divs to be more specific and exclude children of ORA problems in setting due dates

test: extracting dates for a self paced course with custom pacing

test: frontend for self paced custom pacing modal in studio and clean up its backend tests

fix: remove an unused line when getting children of custom pacing subsection, reorganize testing for custom pacing

fix: more specific comments to testing for custom PLS and remove a test case course

fix: more cleanup for self paced custom pacing PLS backend tests
2021-07-08 16:05:38 -04:00
Sofia Yoon
4d96449134 feat: create feature flag for PLS custom pacing 2021-07-08 14:39:04 -04:00
RehanAziz
e0efd9bbf2 feat: Added enterprise uuid in event context for enterprise enrolment events 2021-07-08 10:58:24 +05:00
Matt Tuchfarber
02a7fb0c88 Update version to 15 to force recaching
The version check is `if course_overview.version < cls.VERSION:` so we need to bump to 15 to force it to reuse 13's models.
2021-07-07 17:08:57 -04:00
Matt Tuchfarber
63cb6a97ff Revert "feat: Reimagine certificate_availability_date and certificates_display_behavior" 2021-07-07 16:53:05 -04:00
Matt Tuchfarber
2a7106acfb feat: reimagine certificate display settings
The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously acting indedependantly
of one another. They now work in tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview to validate these fields and choose sane
defaults if they aren't expected values

Certificates will now show under the following circumstances:
"Immediately upon passing"
certificate_availability_date = null
certificates_display_behavior = "early_no_info"

"End date of course"
certificate_availability_date = null
certificates_display_behavior = "end"

"A date after the course end date"
certificate_availability_date = <date>
certificates_display_behavior = "end_with_date"
2021-07-06 16:45:23 -04:00
Bianca Severino
666dc22bd0 Merge pull request #28085 from edx/bseverino/proctoring-course-overview
[MST-864] Add proctoring fields to course overview
2021-07-06 12:03:15 -04:00
Kyle McCormick
d86aa824c1 revert: feat: add & expose courseware.use_learning_sequences_api flag (#28054)
The learning_sequences.use_for_outlines flag was recently added,
intended to serve the same purpose
as courseware.use_learning_seuqences_api. We do not need
both flags.

Furthermore, exposing either flag in the Courseware
Metadata API is neither necessary nor helpful, since
the easiest and quickest way for the Learning MFE to see
if the Learning Sequences API is enabled is to hit it,
and fall back to a different API if a 403 is returned.

This reverts commit 78f1e2b3bd.

TNL-8330
2021-07-06 11:34:40 -04:00
Thomas Tracy
986f52faab [feat] Add has_scheduled_content to outline API
The outline API that the learning MFE needs to know if a course has
upcomming content for a new alert.
2021-07-06 11:33:53 -04:00
Bianca Severino
e1738b71ed feat: add proctoring fields to course overview 2021-07-02 14:26:48 -04:00