Commit Graph

4136 Commits

Author SHA1 Message Date
mariajgrimaldi
c23071defc Fix DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead (#23909)
I wanted to make a byte-sized contribution but there were no Jira tickets so we decided, thanks to a conversation with @jmbowman through the Open Edx Community #incr (Slack) channel, to collaborate in the elimination of warnings listed in the Warnings Report at https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/warning_5freport_5fall_2ehtml/

This PR contributes to the elimination of deprecation warnings, specifically the one mentioned above and reported in the Warnings Report.

Changed logger.warn to logger.warning in the following files:

    lms/djangoapps/experiments/utils.py

    lms/djangoapps/lti_provider/outcomes.py

    lms/djangoapps/courseware/module_render.py

This warning occurs due to deprecation in python 3.4+: https://docs.python.org/3.5/library/logging.html#logging.Logger.warning
2020-05-08 12:15:59 -04:00
Diane Kaplan
cbb4cfb988 Add financial assistance link in course tools (#23921)
Add financial assistance link in course tools for eligible courses, so it'll be more visible to learners
2020-05-08 10:35:10 -04:00
Nicholas D'Alfonso
5d28f0e0c3 Enable masquerade on dates tab 2020-05-06 13:28:22 -04:00
Dillon Dumesnil
10759a9046 Merge pull request #23819 from edx/ddumesnil/more-date-pills-aa-99
AA-99: Adding in new date pills for the dates tab
2020-05-06 06:12:50 -07:00
Simon Chen
262574b815 Move all the upgrade display logic into courseware.utils 2020-05-05 17:54:22 -04:00
Dave St.Germain
2c400184e4 Redirect to courseware MFE, including unit 2020-05-04 13:49:20 -04:00
Dillon Dumesnil
858154a7d6 AA-99: Adding in new date pills for the dates tab 2020-05-04 07:24:01 -07:00
Simon Chen
34d4d162f7 MST-108 Add masquerading fix to the upgrade message display 2020-05-01 16:54:43 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05: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
Robert Raposa
b74acce64c fix issue with is_in_memory_db
For mysql, it seems `is_in_memory_db` does not even exist. Ensure it
exists before calling it.
2020-04-28 16:19:15 -04:00
Dave St.Germain
003d7faac2 Merge pull request #23728 from edx/dcs/dashboard
Refactor instructor dashboard access
2020-04-27 10:25:20 -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
Dave St.Germain
7336ea91fe This refactors instructor dashboard access to use Bridgekeeper permissions and allows the Data Researcher course/org role to access only the data downloads tab of the dashboard.
TNL-7176
2020-04-22 11:06:08 -04:00
Adeel Khan
67ec1d703c Fixes translations for financial assistance page
PROD-1438
2020-04-21 17:16:48 +05: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
SaadYousaf
db95b28b85 handle DeprecationWarning for usage_key.course_key for logs cleanup. 2020-04-15 15:16:58 +05:00
Calen Pennington
c041959a11 Merge pull request #23703 from cpennington/faster-dates-page
Use the course_blocks api to fetch data for date blocks
2020-04-14 11:35:13 -04:00
Adam Butterworth
02a7022571 Reenable Learning Sequence MFE redirect tests (#23691)
* Reenable Learning Sequence MFE redirect tests

TNL-7157 These tests may were the cause of intermittent test failures a couple weeks ago. Here they are reenabled after changing the way ExperimentWaffleFlag is overridden.

* Update is_experiment_on and add ExperimentWaffleFlag override test

* Update test_flags.py

* Add docstring about overrides

* prefer is_experiment_on over _is_enabled
2020-04-14 10:25:38 -04:00
Calen Pennington
9be7341b20 Use the course_blocks api to fetch data for date blocks 2020-04-14 10:08:19 -04:00
Adam Butterworth
f5f6fc49ba Reenable Learning Sequence MFE redirect tests
TNL-7157 These tests may were the cause of intermittent test failures a couple weeks ago. Here they are reenabled after changing the way ExperimentWaffleFlag is overridden.
2020-04-13 14:22:20 -04:00
Jeff LaJoie
a7ac981cd4 Adds in New Relic tracing to Dates view on course_id, user_id, and is_staff 2020-04-10 15:06:10 -04: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
Nicholas D'Alfonso
396050703e AA-97 mobile reset message
- remove code for displaying banner in mobile dates fragment
- replace button with link to web app in reset dates banner on
  the mobile problem template
- adjust spacing of reset dates button in banner when button wraps
  on smaller screen
2020-04-09 12:55:26 -04:00
Jeremy Bowman
c4352a0a78 Fix invalid POST in test_module_render.py (#23639)
This looks like the last failing unit test under Django 2.2. One of a series of such failures resulting from Django no longer accepting None as POST data (since you can't really get it from a real request), most of which were already fixed by the Arbisoft team in the last few days.
2020-04-06 17:18:36 -04:00
Diana Huang
99863aebff Remove course_id field from CourseMode.
Handle this change appropriately in CourseModeFactory.
2020-04-06 11:21:28 -04:00
Nicholas D'Alfonso
ac9d2bfd30 AA-85 mobile reset dates
- render reset dates banner in webview for mobile app.
- improve banner redirect mechanism
2020-04-02 00:37:54 -04:00
David Ormsbee
5ea71beeb1 Make XBlock views/handlers non-atomic requests.
We're seeing slow commits on production for courseware_studentmodule
updates. Based on the slow queries during those times, we think it
might be because multiple worker processes are trying to update the
same rows from within long-running transactions (since courseware
is relatively slow).

The risk with this is that since the whole view execution is no
longer wrapped in a big implicit transaction, it's possible that
XBlock state will update and things that key off of that (e.g.
completion progress information or pre-req milestones) will fail
in a way that will leave the database in an unplanned-for state,
though this is already the case for those actions that trigger
asynchronous tasks like grades recalculation.

The query counts for the index view test were adjusted down
because save points count towards the total and we're no longer
setting them at the top level around the view as a whole.
2020-03-31 21:22:58 -04:00
adeelehsan
82bf1d744a Revert "Added logs for investigation" 2020-03-30 19:15:26 +05:00
adeelehsan
c04341f863 Merge pull request #23509 from edx/aehsan/prod-1222/added_logs_for_investigation
Added logs for investigation
2020-03-27 18:21:21 +05:00
adeelehsan
da875856c8 Added logs for investigation 2020-03-27 17:37:37 +05:00
David Ormsbee
1e8b6d5a00 Make upgrade to get the latest edx-when (1.1.3)
Also pinned httpretty < 1.0 because that upgrade broke many tests.
2020-03-26 12:06:27 -04:00
Adam Butterworth
a2c4b00246 Skip flaky courseware MFE redirect tests (#23483) 2020-03-24 12:50:14 -04:00
Adam Butterworth
1f59463720 Swap courseware-mfe CourseWaffleFlag with ExperimentWaffleFlag (#23429)
TNL-7000
2020-03-23 13:46:42 -04:00
Dillon Dumesnil
a13b695660 AA-74: Only show cert available date in Instructor paced courses 2020-03-18 12:41:27 -07:00
Nicholas D'Alfonso
8e77a822fe AA-73 courseware nonetype error
- ensure logic for displaying reset dealines banner in courseware
  is behind the relative dates waffle flag, only shows if the
  course is self paced, and handles the situation where no
  sequentials exist.
2020-03-17 14:05:15 -04:00
Michael Terry
2e5f2f2be3 Fix error in experiment tracking
If the user is not logged in, the ExperimentWaffleFlag code was
raising an exception when trying to send an event to segment.

This is a quick fix to ignore anonymous users.
2020-03-16 17:40:55 -04:00
Michael Terry
4c241e57fe Add func to generate ics for schedule
This is an unused-as-of-yet utility function to generate a bunch
of ics files for a user's course schedule. Will be used as part
of the calendar_sync feature package.

AA-37
2020-03-16 10:51:51 -04:00
Nicholas D'Alfonso
3cee26feb4 AA-59 show reset dates banner on courseware page
- Also, only show banner if the course end_date has not already
  pass AND if the user is verified within the course.
2020-03-12 19:52:54 -04:00
Waheed Ahmed
f54b9a42e7 Disallow NaN value for speed key.
The VideoBlock `handle_ajax` is allowing NaN values for speed key
and causing videos to not load. Also added a data migration to fix
the data for learners.

PROD-1148
2020-03-11 18:45:49 +05:00
Jeff LaJoie
bbfb630aa8 Uses user local time for dates tab 2020-03-10 13:41:25 -04:00
Jeff LaJoie
e60faeb7f0 Merge pull request #23346 from edx/jlajoie/dates-tab-for-sp-courses
Enables Dates Tab for Self-Paced courses
2020-03-10 08:11:28 -04:00
Michael Terry
f6e85f758c Provide links for self paced blocks
When self paced blocks don't have a start date set, still provide
a link to the block (noticable on dates side bar at the least).
2020-03-09 15:42:37 -04:00
Jeff LaJoie
449ba74b37 Enables Dates Tab for Self-Paced courses 2020-03-09 15:20:46 -04:00
Dave St.Germain
49c5d5194b Addressed review feedback 2020-03-09 11:28:48 -04:00
Dave St.Germain
28f33e1667 Defensive fix 2020-03-09 10:47:00 -04:00
Dave St.Germain
2f148496bf Redirect to learning microfrontend when the waffle flag is set, except for exams 2020-03-09 10:47:00 -04:00
David Ormsbee
ed9062f409 Create flag for Courseware MFE staff rollout.
Create the COURSEWARE_MICROFRONTEND_COURSE_TEAM_PREVIEW
CourseWaffleFlag (courseware.microfrontend_course_team_preview) to
enable us to roll out the new Courseware MFE as a preview to
select course teams without affecting their students. TNL-7117

This commit also fixes an issue where these links are shown in Old
Mongo courses (TNL-7116). Old Mongo is marked for deprecation
(DEPR-58), and is not intended to ever be supported by the new MFE.
2020-03-09 10:01:41 -04:00
David Ormsbee
767f16d795 Fix nested sequence display in Courseware MFE
Check to make sure that "activate_block_id" is actually a Unit
(VerticalBlock) before using it to build a link to the Courseware
MFE. We were previously sending sequence block keys here, causing
the MFE to render a whole sequence where only a unit was desired.

Fixes TNL-7115
2020-03-06 11:01:28 -05:00
David Ormsbee
979906275c Show Courseware MFE link to course staff.
Show a link the courseware MFE to course staff if the
ENABLE_COURSEWARE_MICROFRONTEND feature is enabled and the
REDIRECT_TO_COURSEWARE_MICROFRONTEND CourseWaffleFlag is active
for that course. Previously only global staff could see this link.

This commit also adds ENABLE_COURSEWARE_MICROFRONTEND to
lms/envs/common.py and makes this value True by default on
devstack, since that front end application should soon be part
of devstack: https://github.com/edx/devstack/pull/484

Related to TNL-6982 and TNL-7045.
2020-03-06 11:00:22 -05:00