28 Commits

Author SHA1 Message Date
Kyle McCormick
d701b423f1 fix: repair search of course creator statuses in django admin
It was broken because "organizations" was erronously included
in the `search_fields` admin option. Many-to-many fields
may not be used for search.

TNL-8722
2021-09-14 13:31:08 -04:00
Farhaan Bukhsh
48ad7effb1 feat: grant course/library creation rights by organization (#26616)
Current State (before this commit):

  Studio, as of today doesn't have a way to restrict a user to
  create a course in a particular organization. What Studio
  provides right now is a CourseCreator permission which gives
  an Admin the power to grant a user the permission to create
  a course.

  For example: If the Admin has given a user Spiderman the
  permission to create courses, Spiderman can now create courses
  in any organization i.e Marvel as well as DC.
  There is no way to restrict Spiderman from creating courses
  under DC.

Purpose of this commit:

  The changes done here gives Admin the ability to restrict a
  user on an Organization level from creating courses via the
  Course Creators section of the Studio Django administration
  panel.

  For example: Now, the Admin can give the user Spiderman the
  privilege of creating courses only under Marvel organization.
  The moment Spiderman tries to create a course under some
  other organization(i.e DC), Studio will show an error message.

  This change is available to all Studio instances that
  enable the FEATURES['ENABLE_CREATOR_GROUP'] flag.
  Regardless of the flag, it will not affect any instances that choose
  not to use it.

BB-3622
2021-09-10 12:43:26 -04:00
M. Zulqarnain
3a5be3b074 pyupgrade on course_creators, maintenance and models apps under CMS (#26709) 2021-03-02 16:45:20 +05:00
Zulqarnain
ffb9e6cb4b pylint amnesty in cms apps 2021-02-02 15:31:33 +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
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
Ayub khan
15a89ee0ce python 3 compatibility 2019-07-09 12:51:38 +05:00
Matthew Piatetsky
7df30938c4 fix unicode strings in cms/ 2019-02-04 13:01:51 -05:00
bmedx
48e6e552f2 PLAT-1633: Upgrade django-ratelimit-backend to 1.1.1 2017-08-07 15:34:21 -04:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -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
David Baumgold
f3f4af8087 settings.MITX_FEATURES => settings.FEATURES 2013-12-03 15:34:55 -05:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
cahrens
e6f15bf611 Send notification to admin when a user enters 'pending' state.
Also fixes a bug where message was not sent to user when entering 'denied'
state unless the user was previously in 'granted'.

Send notification to admin when a user enters 'pending' state.

Pylint cleanup.
2013-08-06 16:26:33 -04:00
cahrens
55f2cbc92f Split up event notification, make sorting on username work. 2013-08-06 15:58:55 -04:00
Diana Huang
c867be7961 Limit the rate of logins. 2013-08-02 11:23:59 -04:00
cahrens
23894d20f8 E-mail notifications to users when course creator status changes. 2013-07-29 09:49:37 -04:00
cahrens
283e2b2e60 Don't store abbreviations for state. 2013-07-09 13:07:38 -04:00
cahrens
01557b26be Move call into authz methods out of model class. 2013-07-09 12:47:54 -04:00
cahrens
5a3a03c0d4 Change user to foreign key (tracks deletions). 2013-07-09 10:23:38 -04:00
cahrens
23ffa2a616 Show note field, update filterable. 2013-07-08 16:55:32 -04:00
cahrens
5e8e3353ca Pylint/pep8 cleanup. 2013-07-08 16:07:02 -04:00
cahrens
f1f6acb5c7 Updates to admin table view.
Also hooks up the granted and deny events to the course creator group.
2013-07-03 17:07:06 -04:00
cahrens
2970f24245 Initial admin table view. 2013-07-03 09:24:02 -04:00