Commit Graph

4470 Commits

Author SHA1 Message Date
toxinu
c565f7b850 Remove blank line 2020-04-27 20:05:57 +09:00
toxinu
a68b603638 Can only check user specific permissions if logged in 2020-04-27 17:21:13 +09:00
toxinu
13b2ea6c46 Add test to show exception 2020-04-27 17:20:32 +09:00
Ned Batchelder
82159ae168 Merge pull request #23790 from eduNEXT/lmm/fix_comment
Fix docstring of retrieve_last_sitewide_block_completed
2020-04-25 13:11:57 -04:00
Robert Raposa
5de9eed420 ARCHBOM-1093: Fix unit test enable-migrations (#23789)
* fix old migrations
* fix a test
* fix enable-migrations cmd argument
* enhance verbose logging to log migrations
* update testing doc with help
2020-04-23 14:04:29 -04:00
Tim McCormack
7a406d4417 Cache site config per-request to reduce DB queries from template render (#23791)
ARCHBOM-1139: We were seeing about 150 queries to the django_site table
and over 200 to memcached just to load the login page. A lot of these
are via mako template rendering, but there are other sources, and this
will hopefully nip it in the bud.
2020-04-23 15:37:45 +00:00
stvn
0fa6099802 Get upgrade offer banner HTML in courseware API
for use in the Learning MFE.
2020-04-22 14:14:55 -07:00
Luis Moreno
3d8875d505 Fix docstring of retrieve_last_sitewide_block_completed 2020-04-22 12:45:22 -04:00
Dave St.Germain
1f71b7dc4b TNL-7148
This adds another field to the CourseOverviewTab model to support external links.
2020-04-21 12:16:24 -04:00
Farhanah Sheets
602ebfaf1c Merge pull request #23757 from edx/fsheets/contact-us-hackathon-2
Update wording for clarity and bug fix for API expectations
2020-04-21 10:49:44 -04:00
Zia Fazal
24c0fb2875 Merge pull request #23764 from edx/ziafazal/ENT-2798
ENT-2798: Added more info to log in SSO request/response flow
2020-04-21 16:57:31 +05:00
George Babey
5d62456250 Merge pull request #23671 from open-craft/jill/samesite-cookies
SE-2320 Adds django-cookies-sameseite middleware
2020-04-20 13:15:26 -04:00
zia.fazal@arbisoft.com
f70390d70f Added more info to log in SSO request/response flow
Added more info to log in SSO request/response flow
Fixed django admin links on model's link fields which are broken due to django 2.2 upgrade.
ENT-2798

Fixed quality violations and unit test

Fix xsscommitlint violation

Fixed pylint violation
2020-04-20 14:38:51 +05:00
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