Commit Graph

38 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
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Farhaan Bukhsh
48595cd38d Added tests for ORA button
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:00 -03: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
Kyle McCormick
7538691484 Patch CMS app code in tests using fully qualified names 2020-10-19 09:34:31 -04:00
Sid Verma
c609451d2e [BD-14] Limit number of blocks allowed in content libraries (#24276)
* Enforce limit on number of blocks allowed in library (blockstore)

* Enforce limit on number of blocks allowed in library (modulestore)

* Changes from review feedback
2020-07-13 15:49:47 -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
Nimisha Asthagiri
beb95eb69c Python 3: assertIn -> assertContains consistency 2019-09-30 08:51:01 -04:00
Nimisha Asthagiri
d4832a65aa Python 3: assertNotIn -> assertNotContains consistency 2019-09-30 08:50:38 -04:00
Nimisha Asthagiri
a6b219a9e9 Python-3: assertIn(..response.content) -> assertContains 2019-09-30 08:50:38 -04:00
Awais Qureshi
b8b6dc4883 PROD-662
Photo verification Fixing python3
2019-09-08 20:35:52 +05:00
Ayub khan
c9f0d26747 INCR-330 python3 compatibility 2019-07-09 16:11:28 +05:00
bmedx
46cb89e55d Fixes to CMS failures in Django 1.11 tests 2018-01-23 14:11:06 -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
J. Cliff Dyer
c61f2ddc69 Update xblock requirement to 1.0.0. 2017-05-12 14:51:02 -04:00
noraiz-anwar
074900632a ORAs and Drag and Drop not supported in libraries, remove both from problem types in studio 2017-04-20 18:27:13 +05: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
0682618a57 fix docstring of tests 2016-12-16 08:26:16 +02: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
Calen Pennington
18e1610043 Remove the create_user argument to setUp.
Instead, use a class attribute to define test behavior. This allows for
easier addition of new mixins over time.
2016-05-04 11:35:55 -04: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
Braden MacDonald
24af22ca88 Remove restrictions on library creation in Studio 2015-06-25 12:57:56 -07:00
Ned Batchelder
cc5c1001d1 Fix simplifiable-range pylint warnings. 2015-06-02 09:47:13 -04:00
E. Kolpakov
195d5b57bc pylint fixes 2015-01-12 09:58:51 -08: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
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