Commit Graph

24 Commits

Author SHA1 Message Date
Usama Sadiq
859df03049 refactor: ran pyupgrade on lms/djangoapps/courseware (#26737) 2021-03-12 12:15:58 +05:00
Jawayria
a383845b01 BOM-2352: Removed unused imports from lms/djangoapps/{course_blocks, course_goals, course_home_api, courseware} 2021-02-22 21:44:42 +05:00
Jawayria
03e6a874d0 Applied pylint-amnesty to courseware 2021-02-03 21:56:24 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Jeff LaJoie
efa7b3b816 AA-164: Performance fixes for course home 2020-05-20 10:09:41 -04: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
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Ayub khan
af2e7705b1 INCR-434 python3 compatibility 2019-07-16 15:54:54 +05:00
Calen Pennington
755a5c7db6 Augment content_type_gating tests to detect the failure case from the original REVMI-34 implementation 2019-05-16 15:17:33 -04:00
Matthew Piatetsky
6e81c84d8b fix unicode strings in lms/ part 1 2019-02-05 15:15:02 -05:00
Matthew Piatetsky
9ba3e0c5a5 ensure content start date banner only shows for currently open sections 2019-01-17 12:32:08 -05:00
Matthew Piatetsky
5bb56fe45f add informational banners when masquerading as user who would not have access due to start date 2019-01-10 11:06:30 -05:00
Matthew Piatetsky
fc6cc94573 Ensure masquerade works in courses that haven't started yet 2018-12-19 08:43:54 -05:00
noraiz-anwar
593c2d1ae8 add python getter in capa system 2018-07-18 18:44:56 +05:00
Adeel Khan
5a730aa934 Improve CourseListView end point latency by removing CourseWaffleFlag.
This patch would remove CourseListView slow transaction by changing
CourseWaffleFlag to WaffleFlag. This removes extra hit on
WaffleUtil's model (WaffleFlagCourseOverrideModel).

LEARNER-5566
2018-07-13 16:09:05 +05:00
John Eskew
7dfb6cc681 Change all UTC timezones to import from pytz instead of Django. 2017-10-05 11:12:52 -04:00
Andy Armstrong
aeecf34387 Enable conditional pre-start-date access to courses
LEARNER-1854
2017-07-14 14:00:48 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Diana Huang
3e71a45349 Only show preview bar if student can view it. 2017-05-18 09:16:28 -04:00
Ehtesham
5ad2eb300c [TNL-4073][TNL-4273] Make sure that domain defined for preview exists in
HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS,
2016-03-23 18:52:32 +05:00
Awais Jibran
5899be9207 Fix Beta Testers access courseware in self-paced courses
ECOM-3612
2016-02-10 14:47:03 +05:00
Nimisha Asthagiri
95fdbd981c Refactor has_access for re-usability. 2015-10-26 16:26:41 -04:00