Commit Graph

3988 Commits

Author SHA1 Message Date
Samuel Walladge
9f6b3a873f Make more metadata available via the new runtime's generic XBlock API
Without this PR, there is no [reasonable] way to get the following data
for any XBlocks in the new runtime; now there is :)

* index_dictionary: data about the block content, for search indexing
* student_view_data: data-only equivalent of student_view, for use in
  custom UIs/mobile
* children: list of child IDs
* editable_children: list of child IDs in the same bundle (use case:
  when showing an OLX editor you want to allow editing the OLX of
  children in the same bundle but not linked children)
2020-04-17 13:09:59 -07:00
Braden MacDonald
81b9453462 API to get/update a content library's blockstore bundle links
This adds some simple new python+REST APIs that can be used to create,
read, update, and delete "links" from a content library to other content
libraries.

One can use these links to import content (XBlocks) into a library
without copying the content.

Note that this feature was already fully supported by Blockstore and the
XBlock runtime; it's just that to use it prior to this required one to
use the (lower-level) Blockstore REST API directly to create the links.
Now there is a somewhat higher-level API built in to Studio, using
"content library" abstractions instead of Blockstore primitives.
2020-04-17 13:07:12 -07:00
Farhanah Sheets
7feddd3afa Log update 2020-04-17 15:34:10 -04:00
Farhanah Sheets
8f909e0b35 Attempting to add more logging 2020-04-17 15:18:34 -04:00
Manjinder Singh
b7633d0b94 [CR-2057]: Remove email placeholder (#23739)
* Remove email placeholder

The current placeholder is confusing to users and results in many trying
to login with their username. The change in this PR hopefully decreases that
confusion.

According to UX recommendations, we have decided to remove the email placeholder for the form. It seems placeholders tend to just confuse the users.
2020-04-17 13:50:21 -04:00
Albert (AJ) St. Aubin
a9fb9071cc Add ADR for External ID application 2020-04-17 11:11:07 -04:00
stvn
016d2d8c3f Add content_type_gating_enabled flag to courseware API
to extend the Learner MFE.
2020-04-15 11:28:01 -07:00
stvn
aa1d0a54c7 Merge PR #23709 stv/mfe/learning/audit-access-expiration
* Commits:
  Add audit access expiration message to courseware_api
2020-04-15 11:05:45 -07:00
David Joy
7a400e2917 Factoring redirects out of check_course_access so it can be used with courseware_api (#23651)
TNL-7053

The courseware_api view will use check_course_access - which now returns AccessResponse objects, and all other uses of check_course_access will now use check_course_access_with_redirect, which is a drop-in replacement for the original check_course_access implementation.

We also added a few new helpers to access_utils:

- check_public_access is a replacement for allow_public_access, which now returns AccessResponse objects
 - check_enrollment checks if the learner is enrolled, and uses check_public_access to account for COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
- check_survey checks whether there is a required survey that the learner must complete prior to accessing the course.

There are two new kinds of AccessError subclasses:

- SurveyRequiredAccessError
- EnrollmentRequiredAccessError
2020-04-15 10:29:24 -04:00
Robert Raposa
e56eacebd3 ARCHBOM-1105: fix migration issues (#23708)
* fix direct assignment error
* fix byte string error

ARCHBOM-1105

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2020-04-14 10:53:26 -04:00
asadazam93
ee0bcd36ec Deactivate account 403 error log 2020-04-14 17:44:12 +05:00
stvn
fb830eea88 Add audit access expiration message to courseware_api
to display the banner in the Learner MFE.
2020-04-13 18:01:50 -07:00
Zachary Trabookis
7b3525278e Fix SameSite cookie issue for LTI Provider. EW-449
There was an issue where external LMS system (e.g. Canvas, Blackboard) that used Open edX LTI Provider calls had cookies blocked. This update fixes this issue by defining third-party cookies to have attributes of `Secure=True` and `SameSite=None`.

Details here: https://discuss.openedx.org/t/lti-xblock-and-samesite/759/5

(cherry picked from commit 28479a2966b87b16a25dbc96c19b6f5817d255de)
2020-04-13 17:14:15 +09:30
Robert Raposa
211dcee217 add AppConfig for catalog
ARCHBOM-1105
2020-04-11 15:27:31 -04:00
M Zulqarnain
39dcc8b180 BOM-1514 : Remove waffle switch PREVENT_AUTH_USER_WRITES (#23686)
* Remove waffle switch PREVENT_AUTH_USER_WRITES
2020-04-10 18:21:12 +05:00
Dave St.Germain
543611fbb7 Added edxnotes information to the courseware API.
Added notes visibility toggle support for courseware MFE.
Removed notes and calculator from chromeless view when rendered in courseware MFE.
2020-04-09 13:59:01 -04:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
Zaman Afzal
c7e2f8d49a ENT-2651 Recovery email Field UX logic on Account Settings page was not same to dashboard (#23565) 2020-04-08 16:21:37 +05:00
Hasnain Naveed
332a8329dc Merge pull request #23595 from edx/hasnain-naveed/ENT-2675
ENT-2675 | Added permission for staff user to change the student's en…
2020-04-07 12:46:08 +05:00
Jeremy Bowman
3309078242 Prepare for django-oauth-toolkit 1.3.2 upgrade (#23637)
Prepare to upgrade to django-oauth-toolkit (module name oauth2_provider) 1.3.2 concurrently with the Django 2.2 upgrade (versions after 1.1.3 dropped support for Django 1.11). Key points:

* We can stop using a commit hash since versions 1.3.0 through 1.3.2 have been released since that commit.
* The validator in oauth_dispatch migration 0002 has been removed from DOT, but the whole table was removed in migration 0004 anyway. Newer DOT versions moved where redirect URI validation happens so it's no longer needed here.
* DOT 1.3.0 squashed its original 6 migrations and immediately deleted them. This required some changes in oauth_dispatch migrations 0006 and 0007 to deal with either numbering system.

When deploying to stage and production, we'll need to delete the history for oauth2_provider migrations 0002-0006 first (the new squashed 0001 migration has the same name as the original 0001). The deployment with DOT 1.3.2 will add a new 0002 migration which should then apply cleanly on the existing database state.

Should resolve https://openedx.atlassian.net/browse/BOM-1456 .
2020-04-06 19:10:19 -04:00
Brian Mesick
129788606b Merge pull request #23407 from edx/bmedx/rename_start_end_courseoverview_2
Add writes to new field & data migration for backfiling data
2020-04-06 14:45:15 -04:00
AsadAzam
255dc26231 Merge pull request #23630 from edx/asad/prod-1394-logs
Added temporary logs
2020-04-06 23:32:41 +05:00
hunytalk
42503dd736 Add writes to new field 2020-04-06 14:13:20 -04:00
David Joy
90ec0c17a8 Merge pull request #23585 from edx/djoy/course_metadata_access_check
fix: Improving access check in CoursewareInformation view
2020-04-06 13:05:39 -04:00
Feanil Patel
5b50a8cd97 Merge pull request #23583 from edx/feanil/test_propert_removal
WIP Remove the course_id property on student.CourseEnrollment.
2020-04-06 10:13:10 -04:00
Feanil Patel
7a52a25132 Fix tests that were creating Enrollments via a course_id.
We now either pass in the relevant courseoverview or when creating the
enrollement we use the factory which automatically creates the relevant
CourseOverview object for testing purposes.
2020-04-06 09:37:36 -04:00
asadazam93
2ad8281343 Added temporary logs 2020-04-06 17:12:31 +05:00
zia.fazal@arbisoft.com
f56235248a Improved enterprise target regex
Improved enterprise target regex to include missing
/enterprise/handle_consent_enrollment/{uuid}/course/ endpoint.
ENT-2710
2020-04-06 12:27:44 +05:00
Awais Qureshi
e66de4e49e BOM-1489
None is not a valid value for posting.
2020-04-04 19:52:18 +05:00
David Joy
1b84f815cc Add is_staff and can_load_course to the CourseInfoSerializer. 2020-04-03 14:17:28 -04:00
Waheed Ahmed
69181864cc Fix NoneType object has no attribute backend
We were passing unstripped password value to `authenticate_new_user()`
after creating a user which was resulting in password mismatch and
was raising this error.

PROD-656
2020-04-03 21:17:00 +05:00
Adam Butterworth
8b7ff1ac2a Eliminate extra has staff access checks 2020-04-03 10:21:06 -04:00
Adam Butterworth
4363b1ede0 Refactor public course check to only call if needed 2020-04-03 09:55:28 -04:00
Adam Butterworth
ff33cc54dd fix lint error 2020-04-03 09:46:47 -04:00
hasnain.naveed
4fc1bbaa17 ENT-2675 | Added permission for staff user to change the student's enrollment. 2020-04-03 15:49:18 +05:00
David Joy
3b6a86bb68 fix: Improving access check in CoursewareInformation view
We weren’t using has_access to check user access, which meant we were missing out on a bunch of checks.  This PR adds a local _check_access function to CoursewareInformation.  Ideally we would add this into access.py, but we’re adding it here for now to avoid any unexpected regressions in editing more commonly used code.  This should ultimately be folded into our access system properly.

TNL-7053
2020-04-02 16:00:47 -04:00
Matthew Piatetsky
68777a270a Modify the program dashboard to make it pass the bundle parameter which is necessary to see the program discounted price
REV-1123
2020-04-02 11:34:02 -04:00
Manjinder Singh
96792cde56 Adding samesite cookie option in django 2.1 and above (#23571)
* Adding samesite cookie option in django 2.1 and above

Django 2.1 release note: Added the SESSION_COOKIE_SAMESITE setting to set the SameSite cookie flag on session cookies.
2020-04-02 09:57:18 -04:00
Manjinder Singh
853744656c Changing test to work with django 2.1 and higher (#23573)
This is part of the django 2 upgrade
2020-04-02 09:56:22 -04:00
Nimisha Asthagiri
9278521188 Merge pull request #23576 from edx/arch/django21-logout-cookie
Django2 LoginTest: fix expired cookie date format change
2020-04-02 07:53:58 -04:00
Syed Muhammad Dawoud Sheraz Ali
cd6549748b add credentials saving in VAL (#23561) 2020-04-02 11:21:09 +05:00
Nimisha Asthagiri
27433ecac0 Django2 LoginTest: fix to accommodate expired cookie date format 2020-04-01 18:25:41 -04:00
Muhammad Soban Javed
05e5c7e6ab Merge pull request #23530 from edx/BOM-1428
BOM-1428: Fix Django 2.0 test failures in theming management command
2020-04-02 01:15:42 +05:00
Nimisha Asthagiri
b96d975b97 Django2 enrollments app: course_id str 2020-03-31 14:28:17 -04:00
Nimisha Asthagiri
0a57ff98c0 Merge pull request #23547 from edx/arch/django-22-content-type-gating
Django2 StackedConfigurationModel: Fix query filter
2020-03-31 13:32:38 -04:00
Nimisha Asthagiri
5447e86307 Django2 StackedConfigurationModel: Fix query filter
BOM-1432
2020-03-31 12:45:44 -04:00
adeelehsan
8d840e6f55 Merge pull request #23529 from edx/revert-23509-aehsan/prod-1222/added_logs_for_investigation
Revert "Added logs for investigation"
2020-03-31 12:31:05 +05:00
Tim McCormack
5edc8fd380 Remove test for PREVENT_AUTH_USER_WRITES since code breaks in Django 2 (#23536)
...and it turns out we don't need the switch anymore, anyway.

When we upgraded to Django 1.11, this flag was added in order to
allow for a database migration that would render the user table
unwriteable for up to half an hour:
https://github.com/edx/edx-platform/pull/17561

This involved swapping out the signal handler for logins via
`user_logged_in.disconnect(django_update_last_login)`, but with
Django 2.0, that disconnect is silently failing (returning
false). Likely the disconnect is now happening too soon.
(See edx-platform/common/djangoapps/student/apps.py line 21 in 61e1eda.)

The result is that by the time the waffle switch is consulted, the
normal handler has already run, and the user's last login date has
already been updated.

For now we're just removing the test, and have filed ARCHBOM-1084 for
followup (deleting the switch and related code).
2020-03-30 20:28:18 +00:00
Soban Javed
c76d1cff79 fixed error in theme management commands in django 2.0 2020-03-30 20:43:02 +05:00
adeelehsan
82bf1d744a Revert "Added logs for investigation" 2020-03-30 19:15:26 +05:00