Commit Graph

12296 Commits

Author SHA1 Message Date
Usama Sadiq
e4b8f56e26 Merge pull request #26031 from edx/djangorestfram-upgrade
Upgrade drf version.
2021-01-13 23:29:42 +05:00
Mahyar Damavand
e66ff41194 Change data-language format to ISO639-1 (#25278) 2021-01-13 12:07:59 -05:00
Calen Pennington
f1a9132308 Fix a flaky test error that happened if the factory generated usernames rolled over from 999 to 1000 2021-01-13 10:40:25 -05:00
Calen Pennington
fdac36ec13 Call segment.identify with any changed values when user profile fields change 2021-01-13 10:40:25 -05:00
Awais Qureshi
b6930adb21 Fixed deprecated warning. 2021-01-13 20:35:14 +05:00
Awais Qureshi
c978e5b204 Upgrade drf version. 2021-01-13 20:35:14 +05:00
Robert Raposa
e0aa459732 Merge pull request #26017 from regisb/regisb/refactor_set_request_cache
[BD-21] Get rid of calls to `set_request_cache_with_short_name`
2021-01-13 09:57:13 -05:00
David Ormsbee
098e047fce Merge pull request #25987 from edx/ormsbee/tnl-7636-xblock-access
Check sequence-level gating in render_xblock (TNL-7636)
2021-01-13 09:35:56 -05:00
Ahtisham Shahid
780deeed7a Merge pull request #217 from edx/ahtisham/PROD-1916-p
Error incase of disabled user social login
2021-01-13 16:24:02 +05:00
David Ormsbee
5f94a082ce Check sequence-level gating in render_xblock (TNL-7636).
There is certain gating logic around pre-reqs, timed exams, etc.
that happen at the SequenceModule level, and should be respected
when rendering descendant XBlocks (like individual problems) that
are in that Sequence. Rather than do a risky refactoring, I'm
keeping that logic where it is and having the render_xblock view
climb up through the ancestor list to call the SequenceModule for
that gating information.

We do _not_ check all descendants (so cousin leaf nodes in the
sequence) for cotent-type-based restrictions because sequences can
become very large (esp. when content libraries are used), and there
is a performance overhead.

If the enclosing sequence is gated in some way, we redirect to the
render_xblock view for that sequence, where hopefully some useful
messaging will be available. This is a stopgap. That redirect
should never happen because we should never be calling the leaf
XBlock for a sequence that is restricted in the MFE. But if somehow
we get there anyway, either by bug or by intrepid user fiddling,
it's better to redirect somewhere that an error _might_ be surfaced
rather than just failing.

This will actually be a little overzealous and lock things down
that should be made visible later. If there's a timed exam and the
exam is completed, it should be the case that content is visible
(just read-only). This commit will block the content before the exam
starts (this is right), open the content while the exam is live
(this is right), but make the content unavailable after the exam
period has finished (this is wrong).

But I am going to go forward with this even knowing it's wrong
because:

1. The render_xblock endpoint should never currently be used in
   timed exams in an intentional way. Neither the mobile experience
   nor the courseware MFE support it.
2. This fix will address security concerns for creative access
   patterns, even if it goes too far.
3. We're going to need to do a lot of work to address both pluggable
   access permissions handling and special exams in the courseware
   MFE, and a better implementation can be done then.
4. I've had multiple failed attempts to get this to work without
   breaking things on and off over the course of weeks, and this
   is a relatively low risk way of doing it that doesn't involve
   a major refactoring (though the bill for that will come due
   when we bring timed exams to the MFE).
2021-01-12 12:57:22 -05:00
Régis Behmo
3a29cff016 Get rid of calls to set_request_cache_with_short_name
This method from the toggle legacy classes should not actually be
exposed to all. So we get rid of it by manually setting the cached
value. While we are at it, we convert the STORAGE_BACKING_FOR_CACHE
legacy waffle switch to its modern version. As the flag is not being
used elsewhere, this should not break anything.

We take the opportunity to modernize waffle switches from
block_structure.config: to do so we convert the INVALIDATE_CACHE_ON_PUBLISH and
RAISE_ERROR_WHEN_NOT_FOUND waffle switches from legacy classes to their modern
equivalents. These switches are not used outside of edx-platform, so this
change should not trigger any error.
2021-01-12 16:52:08 +01:00
Nathan Sprenkle
0e194bf517 Add team protection tests for CSV team management (#26019) 2021-01-11 10:42:50 -05:00
Christie Rice
7817c47df1 MICROBA-885 Check whitelisted, even if a grade exists (#26011) 2021-01-11 10:19:16 -05:00
Michael Terry
1482755bbd Show discount deadline in a timezone-aware way
Also, fix it and the access expiration deadline to not hardcode
the date presentation in an American way.
2021-01-08 13:56:18 -05:00
Saad Yousaf
ba7602476b Merge pull request #26002 from edx/saad/TNL-7877
[TNL-7877] - Cleanup branding app.
2021-01-08 13:58:49 +05:00
alangsto
2a10406924 added logging messages in case of decryption exception (#26007) 2021-01-07 15:12:00 -05:00
Usman Khalid
9e38b17202 Convert ErrorModule and NonStaffErrorModule to XBlocks. (#25570) 2021-01-07 10:51:33 -05:00
Muhammad Soban Javed
f62b1c417b replaced task decorator with shared_task decorator (#25925) 2021-01-07 19:46:34 +05:00
alangsto
e9dc5baf79 added two endpoints for IDV decryption on stage (#25939)
simplified public keys

made migration

fixes for quality

added pylint fixes

fixed for pylint

added endpoint to retrieve user's receipt_ids

added tests for 404 with decryption error

fixed for quality

fixed for quality

updates for feedback

removed unnecessary method

fixed quality issue

updated tests
2021-01-07 09:05:33 -05:00
Ali-D-Akbar
8f4ac5c112 disable xsslint 2021-01-07 16:40:10 +05:00
SaadYousaf
d0d3dc84be cleanup branding app. 2021-01-07 15:01:44 +05:00
Carla Duarte
492ce7f217 Merge pull request #25975 from edx/ciduarte/AA-545
AA-545: Include has_scheduled_content in StartDateTransformer
2021-01-06 15:09:48 -05:00
Awais Jibran
5a04fb66ff quality fixes 2021-01-06 22:08:50 +05:00
Ahtisham Shahid
b2466c8c2b Error incase of disabled user social login
Updated status code and manage user func

update auth verification

Fixed auth condition

fixed test failuers

fixed style issues

fixed style issues

Created test for auth disabled use

Code refactor

Fixed form ain auth exchange

Fixed oauth apps with disabled user fail

applied quality fixes

Refactored tests

fixed quality issues

removed extra files

Fixed linter issues

Fixed linter issues
2021-01-06 20:37:01 +05:00
Awais Jibran
159031adc9 quality fixes 2021-01-06 20:23:16 +05:00
Dillon Dumesnil
e17e691d54 AA-501: Use hidden blocks to determine past due status
Blocks that were hidden by access checks would not be used when
calculating past due status for a unit. This adds in a check to
still look at those blocks, but will maintain not rendering them
when being accessed via the MFE
2021-01-06 14:11:03 +00:00
Awais Jibran
7e20cf2215 Provide logo URL from the backend 2021-01-06 17:30:13 +05:00
Carla Duarte
03846e229d AA-545: Include has_scheduled_content in StartDateTransformer 2021-01-05 15:06:24 -05:00
Igor Degtiarov
acbefd1079 Extend appropriate proctoring exam modes if provider allows it. (#25927)
The honor enrollment mode is widely used in OpenEdx installations,
and recently it was not allowed for proctoring exam, but very anticipated.

Current PR makes it possible to start the proctoring exam in the honor enrollment
mode in case the provider is configured in that way.
2021-01-05 13:20:35 -05:00
Naeem Ilyas
62ce0ed7fc Fix incompatible division
While deleting a post, the number of comments are retrieved where API reports wrong number of total pages due to PY3 incompatible division:

response.data["pagination"]
{'previous': None, 'count': 3, 'num_pages': 1.02, 'next': 'http://apros.devstack.lms?ajax=1&page=2'}

Which results in PageNotFoundError:

is_thread)):
  File "/edx/src/discussion-edx-platform-extensions/social_engagement/engagement.py", line 382, in _get_paginated_results
    has_next = response.data["pagination"]["next"]
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/rest_api/views.py", line 526, in retrieve
    form.cleaned_data["requested_fields"],
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/rest_api/api.py", line 1074, in get_response_comments
    raise PageNotFoundError("Page not found (No results on this page).")
openedx.core.lib.exceptions.PageNotFoundError: Page not found (No results on this page).
2021-01-05 20:13:09 +05:00
Awais Qureshi
0423434132 Fixing test failure. 2020-12-31 15:11:00 +05:00
Simon Chen
78407b4a8f MST-400 Update the support verification_api to provide the correct status under the same API used by learner (#25917) 2020-12-21 09:14:57 -05:00
Kyle McCormick
54d5f7f394 Course Blocks API: Fix handling of incorrectly-cased course keys (#25911)
Commit 7f59688 attempted to solve this using
`CourseOverview.course_exists`, but that check is case-
insensitive. This commit instead does a small refactor
to `lms.djangoapps.courseware.get_course` so that we can
handle a failed course lookup without broadly catching
a `ValueError`.
2020-12-18 11:26:29 -05:00
alangsto
30d4106659 added endpoint to retrieve IDV photo urls (#25909)
fixed quality issues

added comment

updated for comments

fixing test

removed typo

readded files

moved settings override

testing adding other keys

not overriding setting
2020-12-18 08:14:44 -05:00
Kyle McCormick
7f59688f9b Course Blocks API: Return 403 instead of 500 for unknown courses (#25906)
Anonymous users (like crawlers) requesting non-existent courses
should get 403, just like logged-in users do. They instead raised
a ValueError.
2020-12-17 18:13:51 -05:00
Kyle McCormick
bb30a27b3e Revert "added endpoint to retrieve IDV photo urls (#25903)"
This reverts commit 356f187559.
2020-12-17 17:08:58 -05:00
alangsto
356f187559 added endpoint to retrieve IDV photo urls (#25903)
fixed quality issues

added comment

updated for comments
2020-12-17 16:13:32 -05:00
Robert Raposa
de16529ab6 Merge pull request #25885 from regisb/regisb/fix-deprecated-waffle-usage
[BD-21] Fix deprecated waffle usage
2020-12-17 12:41:40 -05:00
Carla Duarte
3fb3f913b5 Merge pull request #25661 from edx/ciduarte/AA-131
AA-131: Allow anonymous users through course home MFE
2020-12-16 15:49:20 -05:00
Ned Batchelder
3abd0e8e62 Update the Open edX logo urls (#25898)
The old URLs now serve the new logo, but at the old pixel size.  These
URLs serve the new logo at a natural pixel size.
2020-12-16 15:30:55 -05:00
Dillon Dumesnil
2f7fcdea85 Merge pull request #25897 from edx/ddumesnil/fix-masquerade-for-mfe
Fixes for Shift deadlines during masquerade in Learning MFE
2020-12-16 11:57:23 -08:00
Dillon Dumesnil
e1517223b9 Fixes for Shift deadlines during masquerade in Learning MFE
The change to masquerade in the courseware view allows the proper
viewing of the xblock from the perspective of the masqueraded user.
In this case, it allows a staff user masquerading as a learner to see
their shift dates calls to action inside the MFE (the old view already
had this set up). The second change allows the staff user masquerading
to reset the schedule of the learner being masqueraded via the CTAs
2020-12-16 19:13:33 +00:00
Carla Duarte
99163bdf2c AA-131: Allow anonymous users through course home MFE 2020-12-16 12:58:33 -05:00
Muhammad Soban Javed
bd601cf3a6 Update celery routing for celery 4+ (#25567)
* Update celery routing

- Used routing function instead of class
- Move task queues dictionary to Django settings
- Removed routing_key parameter
- Refactored routing for singleton celery instantiation

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2020-12-16 13:40:47 +05:00
Kyle McCormick
8b1162e6ae Clean up deprecated edx-platform imports of edxmako & util (#25684) 2020-12-15 09:04:03 -05:00
Régis Behmo
c5a0ebe219 Fix missing module_name argument in CourseWaffleFlag constructor
In future versions of edx-toggles, this argument will become mandatory.
2020-12-15 12:30:25 +01:00
Régis Behmo
f29e415353 Fix deprecated usage of WaffleFlag.namespaced_flag_name
As of edx-toggles==1.2.0, the `WaffleFlag.namespaced_flag_name`
attribute is deprecated in favour of `WaffleFlag.name`.
2020-12-15 12:28:57 +01:00
Bianca Severino
a94f83688c Merge pull request #25879 from edx/bseverino/idv-logs
[MST-567] Remove course_key from IDV photo submission
2020-12-14 16:29:51 -05:00
Bianca Severino
d8bfbe96bb Remove course_key from IDV SubmitPhotosView 2020-12-14 15:52:00 -05:00
Michael Terry
cf2e778b56 TNL-7185: clean up unused html blobs from the API
Now that the MFE consumes our data structure for a couple of the
alerts, we no longer need to send raw html at all for them.
2020-12-14 14:26:10 -05:00