Commit Graph

42 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
Kyle McCormick
d4026382a5 [BD-14] Ensure new content libraries map to valid organizations (#25752)
If ORGANIZATIONS_AUTOCREATE, this will create a new
org in the case that the organization is missing.

If !ORGANIZATIONS_AUTOCREATE, this will raise a
validation error in the case that the organization is
missing.

TNL-7646
2020-12-04 09:29:45 -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
Kyle McCormick
a3deb6e317 Sort imports in cms/
Command: `isort --recursive cms/`
2020-10-19 09:34:31 -04: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
Sid Verma
78045115ab Add filtering and search support to library APIs 2020-09-18 10:25:59 -04:00
Adolfo R. Brandes
455dd9db4c New library authoring MFE toggle 2020-08-07 09:22:01 -04: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
Ayub khan
da9c71557b -Remove unicode and use six.text_type 2019-09-02 16:14:02 +05:00
Matthew Piatetsky
7df30938c4 fix unicode strings in cms/ 2019-02-04 13:01:51 -05:00
Jeremy Bowman
5289c7e828 PLAT-1915 Stop using deprecated BaseException.message 2018-01-31 17:22:01 -05:00
Jeremy Bowman
113e8dde61 PLAT-1885 Stop using deprecated BlockUsageLocator properties 2018-01-12 16:40:21 -05:00
Eric Fischer
76d19dbe15 Add DISABLE_LIBRARY_CREATION setting to library creator logic
EDUCATOR-1924
2017-12-11 14:31:02 -05:00
Eric Fischer
a09866622d Move library creator checks to POST-only 2017-12-04 11:55:49 -05:00
Eric Fischer
cb463c0d11 Revert "Revert "Merge pull request #16447 from appsembler/omar/hide-library-button""
This reverts commit 7696727fda.
2017-12-04 11:55:49 -05:00
Eric Fischer
7696727fda Revert "Merge pull request #16447 from appsembler/omar/hide-library-button"
This reverts commit 9a9ef198b2, reversing
changes made to f61cbe75b5.
2017-11-09 13:57:19 -05:00
Omar Al-Ithawi
cb5e76ee06 Hide the create library for non-staff users when DISABLE_COURSE_CREATION 2017-11-04 10:07:43 +02:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
jagonzalr
d112c0b81b show button new library in studio depending on flags and user staff status
add flag DISABLE_LIBRARY_CREATION

add comma

use CourseCreatorRole to determine if user can create a library

add disable library creation feature flag

Conflicts:
	cms/djangoapps/contentstore/views/course.py

ENABLE_CONTENT_LIBRARIES flag

check for course creator role for library creation

Conflicts:
	cms/djangoapps/contentstore/views/course.py

add unit tests

make check of creation of library a true/false for forntend, add security in api call, clean tests

update tests

fix docstring of tests

fixed quality violation

fixed broken unit test and quality violations

Feedback changes and unit test to assert libraries are visible to non staff users too

fixed quality violation and feedback changes
2017-01-30 12:51:35 +05:00
Jesse Zoldak
ff43b823d8 Revert "Feature flag for library creation" 2017-01-11 14:35:19 -05:00
jagonzalr
4f50874fd0 update tests 2016-12-14 12:24:10 +02:00
jagonzalr
ce17c1cdcf make check of creation of library a true/false for forntend, add security in api call, clean tests 2016-11-28 11:19:35 +02:00
Ned Batchelder
2e1238b83e Remove unused imports 2016-04-08 11:23:05 -04:00
John Eskew
df261cd5d6 Remove all request.REQUEST usages - replace with request.GET and/or
request.POST to eliminate Django deprecation messages.
2016-02-22 09:54:26 -05:00
Robert Raposa
3682fac832 Add json escaping to Studio
Make escaping for json simpler and more consistent in Mako templates
- add escape_json_dumps to escape and json.dumps
- add escape_js_str to escape javascript string
- refactor Studio to use escape_json_dumps in Mako templates

TNL-2646: Escape json.dumps
2015-11-04 13:34:42 -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
ba8fd1c21d Eliminate instances of unused-import Pylint violation 2015-07-13 17:33:25 -04:00
Braden MacDonald
24af22ca88 Remove restrictions on library creation in Studio 2015-06-25 12:57:56 -07:00
Andy Armstrong
1689004189 Create a common paginated list view
TNL-2384

Refactored Studio's PagingView to use RequireJS Text and moved it
to common so that it can also be used by LMS.
2015-06-15 13:51:09 -04: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
Jonathan Piacenti
568acb56b0 Library setting for show/hide children previews + client-side code to toggle it. 2015-03-18 08:59:58 -05:00
Jonathan Piacenti
8ad4d081fb Added library import and export via .tar.gz'd XML files. 2015-03-10 21:29:29 +00:00
Ned Batchelder
fb595c89f3 Fix a number of incorrect translation string uses
These were found by the new pylint checker I wrote! :)
2015-02-02 22:38:27 -05:00
E. Kolpakov
195d5b57bc pylint fixes 2015-01-12 09:58:51 -08:00
Matjaz Gregoric
116abf1fc0 Modify error message when library with same org/code exists.
Users are unlikely to change their organization name.
2015-01-12 13:42:54 +03:00
Braden MacDonald
93bb1f58cd Basic UI for managing library users with limited editing functionality (shared with course code) 2015-01-12 13:37:59 +03: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
Braden MacDonald
fefc70c405 Three levels of user permissions for content libraries:
Admin ("Instructor") - Can edit and assign permissions to other users
Normal ("Staff") - Can edit
User - Can view the library and use content from it but cannot edit it or its blocks.
2015-01-12 13:37:58 +03:00
Jonathan Piacenti
058176144e Removed the ability to add Discussion and advanced components to Content Libraries. 2015-01-12 13:37:55 +03:00
Braden MacDonald
3e0f08ebc2 Studio support for creating and editing libraries (PR 6046)
SOL-1, SOL-2, SOL-3
2015-01-12 13:37:50 +03:00