Commit Graph

74 Commits

Author SHA1 Message Date
M. Zulqarnain
41e5403f4e BOM-2369 (D): pyupgrade on contentstore/views (#26767)
* pyupgrade on contentstore/views

* Apply suggestions from code review

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-03-05 14:55:14 +05:00
usamasadiq
96f0915b0f Fixed new pylint warnings.
use generator in any/all()
disable not-callable warnings
disable no-member warnings
Suppressed smaller pylint warnings
Pin edx-proctoring==3.5.0
2021-02-22 16:36:53 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +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
sarina
f414fad0cc Change gendered language to gender-neutral 'they/them/their' 2020-11-02 18:23:13 -05:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -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
aarif
b20eb309ff ran python-modernize and isort on files mentioned in INCR-332
changes made to comply with pylint

refactored the code to comply with PEP8

further changes made to comply with quality

changes made as suggested
2019-07-22 10:02:59 +00:00
Matthew Piatetsky
7df30938c4 fix unicode strings in cms/ 2019-02-04 13:01:51 -05:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
noraiz-anwar
5207e2fc91 Remove access for inactive users 2016-12-14 14:26:11 +05:00
Ayub khan
986209669d Revert "SUST-35 Implementation of course_key_from_string_or_404 to return course_key or raise a 404" 2016-04-28 15:50:17 +05:00
Ayub-khan
d8464dbfb0 -changed method name from "from_string_or_404" to "course_key_from_string_or_404".
-Updated method "course_key_from_string_or_404" to raise message too.
-Wrote tests for "course_key_from_string_or_404" when exception message is given.
-Modified existing methods to use "ddt.data".
-Used Splunk logs to find exectly where we were getting "Invalid Key Error"
-Updated Views where we were getting "Invalid Key Error" in splunk logs.
-Wrote tests for those View End points where we were getting "Invalid Key Error"
2016-04-14 15:57:39 +05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Adam
2735b2b5bb Revert "Decorated instructor dashboard with sudo_required." 2015-07-17 12:11:38 -04:00
Waheed Ahmed
bc052db1ee Added DjangoSudo functionality for instructor dashboard and course team page 2015-07-16 11:14:11 +05:00
Sarina Canelake
e53b9c83d9 Use Django 1.4 @ensure_csrf_cookie method PLAT-664 2015-06-06 08:48:36 -04:00
E. Kolpakov
9a56b800ee Unified Course Team and Library Users page. Converted both to Backbone.
Converted lettuce Course Team page tests to bok choy
2015-03-24 12:09:19 +03:00
E. Kolpakov
195d5b57bc pylint fixes 2015-01-12 09:58:51 -08:00
Braden MacDonald
c477bab6f4 Update the REST API course_team_handler to support library roles, fix bugs 2015-01-12 13:37:58 +03:00
Brandon DeRosier
046e295322 Change has_course_access definition and doc string
- has_course_access renamed to has_course_author_access for clarity
- Changed doc string to clearly state that it determines whether or not
  a user has write access to a course
2014-12-02 22:08:58 -05:00
Brandon DeRosier
bdc64a7c70 Moved has_course_access from CMS to student.auth (common) 2014-12-02 19:36:38 -05:00
stv
fb9f324f2f Fix PEP8: E303 too many blank lines 2014-11-10 11:00:14 -08:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
Calen Pennington
0d88379eeb Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit adds all of cms.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-07 12:56:43 -04:00
Don Mitchell
ad3140a6e6 Cleaned up modules to reflect centralizing auth 2014-01-14 17:04:44 -05:00
Don Mitchell
3ebac80778 Replace authz fns with roles.py ones
STUD-1006
2014-01-14 17:04:44 -05:00
Don Mitchell
b7368ef69a Change course_id to package_id
on new Locators to make it clear that they have a different syntax
than Location.course_id altho they represent the same info.
2013-12-20 16:16:50 -05:00
Don Mitchell
b776590226 Rename BlockUsageLocator's block_id field from usage_id
usage_id implies self-sufficiency. The block_id is relative to its structure.
2013-12-17 12:15:32 -05:00
David Baumgold
69899e24df Merge pull request #1823 from edx/db/mitxmako-edxmako
mitxmako => edxmako
2013-12-03 11:36:50 -08:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
Don Mitchell
9dc68b03a0 Improve auth handling of Locators
Ensure user admin screen gets the union of all possibly matching group names.
Smarter default group naming.
STUD-1003
2013-12-02 15:28:22 -05:00
Don Mitchell
f41816637e RESTful refactoring of /course access continued
Move index access into the url
Move course creation into the url
Add helper methods for testing to serialize json data and set accept header.
2013-10-30 13:28:22 -04:00
cahrens
355ebd62e3 Convert course team management to new URL scheme.
Move RESTful URLs into our "done" section.
2013-10-24 14:01:24 -04:00
Don Mitchell
8902a89fbc Have urls.py fully parse locator url 2013-10-22 10:44:03 -04:00
Don Mitchell
010905eb99 RESTful api for getting course listing and opening course in studio.
Pattern for how to do refactoring from locations to locators and from
old style urls to restful ones.
2013-10-16 16:54:31 -04:00
Christina Roberts
03b6050348 Merge pull request #667 from edx/christina/read-only-api
Make split mongo read-only API consistent with other modulestores.
2013-08-15 13:05:58 -07:00
David Ormsbee
3ce87583ab Shift enroll/unenroll logic to CourseEnrollment model, add is_active and mode.
Features coming down the pipe will want to be able to:
* Refer to enrollments before they are actually activated (approval step).
* See what courses a user used to be enrolled in for when they re-enroll in
  the same course, or a different run of that course.
* Have different "modes" of enrolling in a course, representing things like
  honor certificate enrollment, auditing (no certs), etc.

This change adds an is_active flag and mode (with default being "honor").
The commit is only as large as it is because many parts of the codebase were
manipulating enrollments by adding and removing CourseEnrollment objects
directly. It was necessary to create classmethods on CourseEnrollment to
encapsulate this functionality and then port everything over to using them.

The migration to add columns has been tested on a prod replica, and seems to be
fine for running on a live system with single digit millions of rows of
enrollments.
2013-08-14 13:23:06 -04:00
cahrens
e0aa46ab2d Make split mongo read-only API consistent with other modulestores. 2013-08-13 15:06:08 -04:00
ichuang
12ad9c8558 make CMS user view not show ErrorDescriptor courses 2013-08-11 15:27:12 +00:00
Christina Roberts
4c95078eb0 Merge pull request #578 from edx/christina/autoenroll
Auto-enroll course staff to fix "View Live".
2013-08-06 12:33:56 -07:00
chrisndodge
b24fdd9e22 Merge pull request #576 from edx/feature/cdodge/display-location-information-in-course-listings
Feature/cdodge/display location information in course listings
2013-08-06 10:27:38 -07:00
cahrens
3732d418c9 Add helper methods to hide internals of how users are enrolled in courses.
Remove _

Minor cleanup.
2013-08-06 09:36:39 -04:00
cahrens
a227b14fdd Auto-enroll course staff to fix "View Live".
STUD-554

Code review feedback.
2013-08-05 15:00:37 -04:00
David Baumgold
94976df8d7 Check that content-type starts with application/json
When Chrome sends the AJAX request to add a user to the course team, it sets the
Content-type to "application/json". However, when Firefox sends the same request,
it sets the Content-type to "application/json; charset=UTF-8". This commit only
checks that the Content-type begins with "application/json", not is identical
to it; that way, Firefox can play, too.
2013-08-05 14:16:28 -04:00
Chris Dodge
09a3bc01be show the organization, course number, course run in the course listing page in CMS 2013-08-05 12:51:42 -04:00
David Baumgold
607c06cba8 Stop using authz functions to change user groups
They contain too much incorrect permission checking
2013-08-01 11:24:42 -04:00
David Baumgold
64566c14e6 Fix unit tests 2013-07-29 13:12:07 -04:00
David Baumgold
a1b44afda3 Only instructors may make other instructors on a course 2013-07-29 13:12:05 -04:00