Commit Graph

5629 Commits

Author SHA1 Message Date
Nicholas D'Alfonso
21358b764e add logs for debugging 2020-05-01 15:19:26 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Dave St.Germain
2c12792be2 Merge pull request #23857 from edx/dcs/wikitab
Fixes hidden tabs showing up in courseware MFE.
2020-05-01 10:10:26 -04:00
Calen Pennington
810f29c12c Merge pull request #23855 from cpennington/aa-138-reset-dates-graded-only
Only show the resets date banner if you have missed the due date on a…
2020-04-30 14:02:39 -04:00
Dave St.Germain
2def3f427d Fixes hidden tabs showing up in courseware MFE. TNL-7149
Refactors courseware metadata code.
Enables masquerading in the courseware metadata API.
2020-04-30 12:19:43 -04:00
Calen Pennington
ff88f3d423 Only show the resets date banner if you have missed the due date on a graded subsection
[AA-138]
2020-04-30 11:50:45 -04:00
David Ormsbee
d1da021d77 Merge pull request #23469 from open-craft/blockstore-race-condition
Cache Blockstore XBlock field data per thread, not per-process
2020-04-30 11:33:43 -04:00
David Ormsbee
431fdb9009 Merge pull request #23233 from open-craft/blockstore-library-links
REST API for managing Content Library bundle links
2020-04-30 11:32:48 -04:00
Waheed Ahmed
07465b2b35 Ratelimit password reset by email instead of IP.
Also changed `password_reset` endpoint rate limit configuration to
1/minute from 30/5 minutes.

PROD-1427
2020-04-30 14:50:47 +05:00
Dave St.Germain
0c67d91b16 Merge pull request #23774 from edx/dcs/tabfields
TNL-7148 -- support external links in courseware API
2020-04-29 09:31:14 -04:00
Dave St.Germain
fbc18460ca Add support for external user ids to the xblock user service. 2020-04-29 08:55:40 -04:00
Adeel Khan
9778e69c76 Removes enterprise filter for account recovery banner
Previously code was only showing banner for enterprise
learners. This patch would remove this restriction
and is available to all edX learners provided that
'enable_secondary_email_feature' is switched on.

PROD-1477
2020-04-29 17:44:25 +05:00
Robert Raposa
e63a7a4920 Revert "remove tests causing flakiness (#23827)" (#23830)
This reverts commit be1aaa00ff.
2020-04-28 17:31:45 -04:00
Robert Raposa
be1aaa00ff remove tests causing flakiness (#23827)
These removed tests can be restored once someone works out why they
were causing flakiness elsewhere and fix the problem.

Reverts tests added in:
dca50aacc3
2020-04-28 16:12:29 -04:00
David Ormsbee
617fe431e1 Merge pull request #23246 from open-craft/samuel/lx-744-more-metadata
[SE-2264] [LX-744] Return more metadata in xblock api
2020-04-28 15:10:27 -04:00
Braden MacDonald
cb58873879 Cache Blockstore XBlock field data per thread, not per-process
The cache in the previous version of this code was unwittingly being
shared among all threads, and an occasional race condition would result
in the .children field of some XBlocks containing duplicate entries.

I tried to find other ways to keep the existing cache design and let it
be shared among all the threads (which would be more efficient), but I
couldn't find any clean way of doing it (and even then, this code was
not written with the intention of being used in a multi-threaded way).
So to keep the fix simple, I made the block data cache thread-local
instead of process-local. That eliminated the bug.

Technical details:

The big challenge with this code in the first place was due to the
parse_xml API of XBlocks, which instantiates the XBlock instance and
_then_ sets field data on it and returns it, as there is no mechanism
available to distinguish that from the case of instantiating an XBlock
(using previously loaded/cached field data) and then deliberately
changing its field values. In particular, parse_xml sets the 'children'
field just by calling self.children.append(...) but never explicitly
initializes self.children to [] first, so it's necessary for the field
data store to have a mechanism for setting self.children = [] when
parsing begins, but it's hard to know "when parsing begins" in general.

This is made more challenging since the BlockstoreFieldData design ties
field data changes to the XBlock instance itself (using a weakkey), but
it's impossible to get a reference to the XBlock instance before calling
parse_xml, and since the BlockstoreFieldData design uses a pass-through
approach where fields that aren't being actively changed are read from
the cache; since it doesn't know when children is being initialized vs.
being modified, it would sometimes pass-through and start one thread's
changes with the final result from another thread.

Anyhow, the bottom line is that avoiding unintentional multithreading
here solves the problem.

If we want the field data cache to be shared among threads, it might as
well be rewritten to use memcached and shared among all processes too.
That would be a very good performance boost but would take up a lot more
memory in memcached. Also the rewrite may be challenging due to the
aforementioned nuances of the XBlock parse_xml / construct_xblock /
add_node_as_child APIs. Perhaps modifying the runtime to use a
completely separate fielddata implementation for parsing vs. loading a
parsed+cached XBlock would do it.
2020-04-28 12:01:44 -07:00
Ahtisham Shahid
f14946d1de Merge pull request #23749 from edx/ahtisham/PROD-1476
Disabled copy/paste in confirm email
2020-04-28 13:16:01 +05:00
Ahtisham Shahid
8af94ec72a Disabled copy/paste in confirm email
Created sorting for email field

updated tests

Fixed sorting issue in registration form

Fixed sorting issue in registration form

Fixed sorting issue in registration form

Added missing items in env and updated order logic

Added missing items in env and updated order logic
2020-04-28 11:51:01 +05:00
Michael Terry
c5078aa063 Merge pull request #23803 from edx/mikix/lti-icons
Show graded icons in more places
2020-04-27 10:19:38 -04:00
Waheed Ahmed
dca50aacc3 added tests for revoke program cert task 2020-04-27 16:35:36 +05:00
Waheed Ahmed
6a7dc067da Add revoke program certificate task.
Upon invalidating course certificate, revoke related program certificates
as well.

PROD-1271
2020-04-27 16:35:36 +05:00
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
Michael Terry
0f81765ac7 Show graded icons in more places
In the course outline, if a subsection has any graded content,
show a graded icon (the pencil icon).

Also, show the graded icon for LTI xmodule units (xblocks is a
different repo, but will get same treatment).

AA-75
2020-04-24 14:16:32 -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
HammadAhmadWaqas
11893ad69e refactored imports from edx-django-utils 2020-04-20 12:11:28 +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
Nick
ca3012c07b Merge pull request #23707 from edx/ndalfonso/AA-83-special-exam-icon
AA-83 special exam icon
2020-04-14 11:56:35 -04:00
Nicholas D'Alfonso
9e41268322 AA-83 special exam icon
- fix template rendering so that pencil icon is displayed for
  a special exam and also ensure it is not rendered twice
2020-04-14 11:08:44 -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
Hammad Ahmad Waqas
3c1405369e Merge pull request #23699 from edx/hammad/ENT-2724
ENT-2724 | removed get_cache_key and using it from edx-django-utils.
2020-04-14 12:10:01 +05:00