Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
03bcc93
chore: upgrade Django to 3.2.13
nedbat Apr 12, 2022
7b5e9a5
fix: apply SAML configuration security patch
nedbat Apr 12, 2022
2a5564c
build: kickoff the Nutmeg release
regisb Apr 12, 2022
894ed27
feat!: Use more-trusted IP in rate-limiting (#241) (#30285)
timmc-edx Apr 20, 2022
ea5de84
build: Remove empty coursegraph module (and the pylint reference to i…
timmc-edx Apr 21, 2022
78e3fe6
fix(process_warnings): escape html text so that <class ..> doesn't di…
Apr 26, 2022
4fea700
feat(process_warnings): remove data noise from messages, so they grou…
Apr 26, 2022
88a5e41
build: the Django matrix needs to use the pinned version also.
Feb 8, 2022
3fd6764
Merge pull request #29779 from open-craft/jill/TNL-8746
bszabo Apr 21, 2022
c089415
chore: adds drf-nested-routers to the requirements
pomegranited May 11, 2022
2943b5a
feat: Node16 upgrade (#30441)
aht007 May 24, 2022
4a3c6df
feat: add lockfile check (#30440) (#30443)
aht007 May 24, 2022
489ed46
chore: update Docker Image to use node 16 (#30459)
aht007 May 24, 2022
61793b8
Revert "chore: update Docker Image to use node 16 (#30459)" (#30478)
aht007 May 25, 2022
5dbeb65
Revert "feat: add lockfile check (#30440) (#30443)" (#30479)
aht007 May 25, 2022
d91d468
Revert "feat: Node16 upgrade (#30441)" (#30482)
aht007 May 25, 2022
f69b576
fix: cross-site scripting vulnerability on logout page (#30544)
waheedahmed Jun 6, 2022
2b623c6
fix: share urls in course about page (#30389)
ghassanmas May 31, 2022
b3a8087
fix: unpin python dateutil version
mumarkhan999 Jun 8, 2022
6c229bd
chore: upgrade python requirements
iamsobanjaved Jun 8, 2022
26d8e98
Merge pull request #30518 from ghassanmas/fix-url-share
giovannicimolin Jun 8, 2022
4da22ec
Merge pull request #30555 from openedx/umar/unpin_python_dateutil_ver…
giovannicimolin Jun 8, 2022
8f5fe00
fix: add () to print statement so template works in newer versions
mariajgrimaldi Jun 10, 2022
ddf7808
feat: Open edX Filters backport
mariajgrimaldi Feb 17, 2022
81a0d66
chore: update openedx-filters to latest release
mariajgrimaldi Jun 14, 2022
bc5b34e
fix: transifex config file syntax
regisb Jun 9, 2022
a11ad35
merge(#30570): fix: update problem with hint template for python newe…
github-actions[bot] Jun 28, 2022
ab57dc9
Modify unit tests to run on gh hosted for nutmeg (#30679)
aht007 Jun 30, 2022
46888e8
chore: unpin pymongo (#30657)
aht007 Jul 1, 2022
4cf8251
fix: login endpoint username param rate limiting (#30673) (#30681)
waheedahmed Jul 6, 2022
9c8e62e
fix: update LTI XBlock to fix DarkLangMiddleware issue
Jul 7, 2022
41b18d0
refactor: [BB-6077] allow setting celery backend in yml
navinkarkera Apr 13, 2022
1172248
fix: bump bleach and django-wiki versions (#30263)
UsamaSadiq Apr 20, 2022
a336dbf
chore: bump django-wiki version to 1.1.1 (#30709)
keithgg Jul 25, 2022
294c1f3
merge(#30572): refactor: [BB-6077] allow setting celery backend in yml
github-actions[bot] Aug 2, 2022
0ed3cfc
chore(i18n): update translations (#30383)
May 13, 2022
a4e8854
chore: upgrade Django to 3.2.15
BbrSofiane Aug 4, 2022
1d61805
merge(#30583): [BD-32] feat: Open edX Filters backport
github-actions[bot] Aug 8, 2022
a9b3ca0
feat: Implement feature flag to disable students un-enrollment (#29326)
0x29a Apr 22, 2022
6541580
feat: update enrollment serializer and add problem submission history…
xirdneh Jul 3, 2019
216a206
fix: monkey-patch django db introspection to avoid performance issues
mtyaka Aug 23, 2021
1c228db
feat: change studio schedule datetime inputs to user timezone
kaustavb12 Dec 23, 2021
5773cc1
fix: Bump edx-search version to 3.4.0
0x29a Sep 22, 2022
47ecf01
fix: Convert password compliance warning to html
pkulkark Mar 26, 2022
47f2f91
fix: do not index solutions in CAPA blocks
Agrendalath Oct 25, 2021
dec33d1
feat: add reset option to Randomized Content Block
tecoholic Sep 1, 2021
004f2fe
feat: Allow delete course content in Studio only for admin users
Jun 7, 2021
b16c266
feat: Make course description editable in certs
pkulkark Feb 1, 2022
f2cbb13
feat: Added date configuration to Schedule & Details settings page
farhaanbukhsh Apr 25, 2022
62cd116
test: do not collect warnings while counting tests
Agrendalath Jun 3, 2022
47ac9a7
fix: Check if feature is enabled before calling enterprise api
pkulkark Jul 5, 2022
ff6d92f
feat: allow switching anonymous user ID hashing algorithm from shake …
kaustavb12 Aug 8, 2022
667ab7f
feat: added new setting CUSTOM_RESOURCE_TEMPLATES_DIRECTORY
keithgg Mar 23, 2022
9f2f922
Merge pull request #490 from open-craft/0x29a/bb6692/cherrypick-code-…
0x29a Oct 6, 2022
e3314a4
feat: disable allowed enrollment if enrollment closed
kaustavb12 Dec 9, 2021
13abc2c
feat: upgrade TinyMCE v4.0.20 to TinyMCE v5.5.1 (#30335)
DubeySandeep Sep 19, 2022
e6a2363
feat: update ora2 version for TinyMCE5 support
Agrendalath Oct 7, 2022
0c4f2c5
fix: regenerate the cache on due date extensions
Agrendalath Sep 15, 2022
85cb895
fix: preview mode navigation previous button (that uses legacy UI)
navinkarkera Oct 11, 2022
c33058d
feat: Add flag to skip course publish while backfilling tabs (#498)
pkulkark Oct 31, 2022
2f9c61e
fix: studio submit handler
connorhaugh Oct 27, 2022
a46aed3
fix: add fix for XSS Vulnerability and Open Redirect
syedsajjadkazmii Nov 4, 2022
9c853f7
fix: retrieve raw content from TinyMCE editor
asadali145 Oct 26, 2022
46fbdaa
feat: allow overriding TinyMCE config using settings
tecoholic Nov 23, 2022
1ccd8d9
feat!: update Drag and Drop v2 XBlock to prevent XSS vulnerabilities
Agrendalath Nov 28, 2022
5f82625
fix: Fix retiring user auth models on disable event
moeez96 Sep 6, 2022
884156e
Merge pull request #514 from open-craft/keith/backport-jwt-oc
mtyaka Dec 6, 2022
fa37476
fix: use language specified in SiteConfiguration
Agrendalath Dec 6, 2022
a3f869a
test: fix `TestCourseStatusGET`
Agrendalath Dec 7, 2022
611859c
Merge pull request #516 from open-craft/agrendalath/bb-6930-fix_site_…
Agrendalath Dec 9, 2022
2b6c0b4
feat: adds openedx-filter hook to the child blocks of VerticalBlock (…
pkulkark Feb 1, 2023
1f04787
feat: Add toggle to allow redirecting to courseware after enrollment.
xitij2000 Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/actions/verify-tests-count/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ runs:
- name: collect tests from all modules
shell: bash
run: |
echo "root_cms_unit_tests_count=$(pytest --collect-only --ds=cms.envs.test cms/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "root_lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test lms/ openedx/ common/djangoapps/ common/lib/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "root_cms_unit_tests_count=$(pytest --collect-only --ds=cms.envs.test -p no:warnings cms/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "root_lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test -p no:warnings lms/ openedx/ common/djangoapps/ common/lib/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV

- name: get GHA unit test paths
shell: bash
Expand All @@ -19,8 +19,8 @@ runs:
- name: collect tests from GHA unit test shards
shell: bash
run: |
echo "cms_unit_tests_count=$(pytest --collect-only --ds=cms.envs.test ${{ env.cms_unit_test_paths }} -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test ${{ env.lms_unit_test_paths }} -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "cms_unit_tests_count=$(pytest --collect-only --ds=cms.envs.test -p no:warnings ${{ env.cms_unit_test_paths }} -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test -p no:warnings ${{ env.lms_unit_test_paths }} -q | head -n -2 | wc -l)" >> $GITHUB_ENV


- name: add unit tests count
Expand Down
17 changes: 0 additions & 17 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!--

🍁🍁
🍁🍁🍁🍁 🍁 Note: the Maple master branch has been created. Please consider whether your change
🍁🍁🍁🍁 should also be applied to Maple. If so, make another pull request against the
🍁🍁🍁🍁 open-release/maple.master branch, or ping @nedbat for help or questions.
🍁🍁

Please give your pull request a short but descriptive title.
Use conventional commits to separate and summarize commits logically:
https://open-edx-proposals.readthedocs.io/en/latest/oep-0051-bp-conventional-commits.html

Use this template as a guide. Omit sections that don't apply. You may link to information rather than copy it.
More details about the template are at https://github.com/edx/open-edx-proposals/pull/180
(link will be updated when that document merges)
-->

## Description

Describe what this pull request changes, and why. Include implications for people using this change.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pylint-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- module-name: lms-2
path: "lms/djangoapps/gating/ lms/djangoapps/grades/ lms/djangoapps/instructor/ lms/djangoapps/instructor_analytics/ lms/djangoapps/discussion/ lms/djangoapps/edxnotes/ lms/djangoapps/email_marketing/ lms/djangoapps/experiments/ lms/djangoapps/instructor_task/ lms/djangoapps/learner_dashboard/ lms/djangoapps/lms_initialization/ lms/djangoapps/lms_xblock/ lms/djangoapps/lti_provider/ lms/djangoapps/mailing/ lms/djangoapps/mobile_api/ lms/djangoapps/monitoring/ lms/djangoapps/ora_staff_grader/ lms/djangoapps/program_enrollments/ lms/djangoapps/rss_proxy lms/djangoapps/static_template_view/ lms/djangoapps/staticbook/ lms/djangoapps/support/ lms/djangoapps/survey/ lms/djangoapps/teams/ lms/djangoapps/tests/ lms/djangoapps/user_tours/ lms/djangoapps/verify_student/ lms/envs/ lms/lib/ lms/tests.py"
- module-name: openedx-1
path: "openedx/core/types/ openedx/core/djangoapps/ace_common/ openedx/core/djangoapps/agreements/ openedx/core/djangoapps/api_admin/ openedx/core/djangoapps/auth_exchange/ openedx/core/djangoapps/bookmarks/ openedx/core/djangoapps/cache_toolbox/ openedx/core/djangoapps/catalog/ openedx/core/djangoapps/ccxcon/ openedx/core/djangoapps/commerce/ openedx/core/djangoapps/common_initialization/ openedx/core/djangoapps/common_views/ openedx/core/djangoapps/config_model_utils/ openedx/core/djangoapps/content/ openedx/core/djangoapps/content_libraries/ openedx/core/djangoapps/contentserver/ openedx/core/djangoapps/cookie_metadata/ openedx/core/djangoapps/cors_csrf/ openedx/core/djangoapps/course_apps/ openedx/core/djangoapps/course_date_signals/ openedx/core/djangoapps/course_groups/ openedx/core/djangoapps/coursegraph/ openedx/core/djangoapps/courseware_api/ openedx/core/djangoapps/crawlers/ openedx/core/djangoapps/credentials/ openedx/core/djangoapps/credit/ openedx/core/djangoapps/dark_lang/ openedx/core/djangoapps/debug/ openedx/core/djangoapps/demographics/ openedx/core/djangoapps/discussions/ openedx/core/djangoapps/django_comment_common/ openedx/core/djangoapps/embargo/ openedx/core/djangoapps/enrollments/ openedx/core/djangoapps/external_user_ids/ openedx/core/djangoapps/zendesk_proxy/ openedx/core/djangolib/ openedx/core/lib/ openedx/core/tests/ openedx/core/djangoapps/course_live/"
path: "openedx/core/types/ openedx/core/djangoapps/ace_common/ openedx/core/djangoapps/agreements/ openedx/core/djangoapps/api_admin/ openedx/core/djangoapps/auth_exchange/ openedx/core/djangoapps/bookmarks/ openedx/core/djangoapps/cache_toolbox/ openedx/core/djangoapps/catalog/ openedx/core/djangoapps/ccxcon/ openedx/core/djangoapps/commerce/ openedx/core/djangoapps/common_initialization/ openedx/core/djangoapps/common_views/ openedx/core/djangoapps/config_model_utils/ openedx/core/djangoapps/content/ openedx/core/djangoapps/content_libraries/ openedx/core/djangoapps/contentserver/ openedx/core/djangoapps/cookie_metadata/ openedx/core/djangoapps/cors_csrf/ openedx/core/djangoapps/course_apps/ openedx/core/djangoapps/course_date_signals/ openedx/core/djangoapps/course_groups/ openedx/core/djangoapps/courseware_api/ openedx/core/djangoapps/crawlers/ openedx/core/djangoapps/credentials/ openedx/core/djangoapps/credit/ openedx/core/djangoapps/dark_lang/ openedx/core/djangoapps/debug/ openedx/core/djangoapps/demographics/ openedx/core/djangoapps/discussions/ openedx/core/djangoapps/django_comment_common/ openedx/core/djangoapps/embargo/ openedx/core/djangoapps/enrollments/ openedx/core/djangoapps/external_user_ids/ openedx/core/djangoapps/zendesk_proxy/ openedx/core/djangolib/ openedx/core/lib/ openedx/core/tests/ openedx/core/djangoapps/course_live/"
- module-name: openedx-2
path: "openedx/core/djangoapps/geoinfo/ openedx/core/djangoapps/header_control/ openedx/core/djangoapps/heartbeat/ openedx/core/djangoapps/lang_pref/ openedx/core/djangoapps/models/ openedx/core/djangoapps/monkey_patch/ openedx/core/djangoapps/oauth_dispatch/ openedx/core/djangoapps/olx_rest_api/ openedx/core/djangoapps/password_policy/ openedx/core/djangoapps/plugin_api/ openedx/core/djangoapps/plugins/ openedx/core/djangoapps/profile_images/ openedx/core/djangoapps/programs/ openedx/core/djangoapps/safe_sessions/ openedx/core/djangoapps/schedules/ openedx/core/djangoapps/self_paced/ openedx/core/djangoapps/service_status/ openedx/core/djangoapps/session_inactivity_timeout/ openedx/core/djangoapps/signals/ openedx/core/djangoapps/site_configuration/ openedx/core/djangoapps/system_wide_roles/ openedx/core/djangoapps/theming/ openedx/core/djangoapps/user_api/ openedx/core/djangoapps/user_authn/ openedx/core/djangoapps/util/ openedx/core/djangoapps/verified_track_content/ openedx/core/djangoapps/video_config/ openedx/core/djangoapps/video_pipeline/ openedx/core/djangoapps/waffle_utils/ openedx/core/djangoapps/xblock/ openedx/core/djangoapps/xmodule_django/ openedx/core/tests/ openedx/features/ openedx/testing/ openedx/tests/"
- module-name: common
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests-gh-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
run-test:
if: github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private'
if: (github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == true))
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
uses: ./.github/actions/unit-tests

collect-and-verify:
if: github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private'
if: (github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == true))
runs-on: ubuntu-20.04
strategy:
matrix:
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ on:

jobs:
run-tests:
if: github.repository == 'openedx/edx-platform' || github.repository == 'edx/edx-platform-private'
if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-plastform' && (startsWith(github.base_ref, 'open-release') == false))
runs-on: [ edx-platform-runner ]
strategy:
matrix:
python-version: ['3.8']
django-version: ["3.2"]
django-version:
- "pinned"
#- "4.0"
shard_name: [
"lms-1",
"lms-2",
Expand All @@ -37,7 +39,9 @@ jobs:
steps:
- name: sync directory owner
run: sudo chown runner:runner -R .*
- uses: actions/checkout@v2

- name: checkout repo
uses: actions/checkout@v2

# This gives Mongo several chances to start. We started getting flakiness
# around 2022-02-15 wherein the start command would sometimes exit with:
Expand All @@ -58,7 +62,15 @@ jobs:
run: |
sudo pip install -r requirements/pip.txt
sudo pip install -r requirements/edx/testing.txt
sudo pip install "django~=${{ matrix.django-version }}.0"
if [[ "${{ matrix.django-version }}" == "pinned" ]]; then
sudo pip install -r requirements/edx/django.txt
else
sudo pip install "django~=${{ matrix.django-version }}.0"
fi

- name: list installed package versions
run: |
sudo pip freeze

- name: Setup and run tests
uses: ./.github/actions/unit-tests
Expand Down Expand Up @@ -90,5 +102,3 @@ jobs:
name: pytest-warning-report-html
path: |
reports/pytest_warnings/warning_report_all.html


11 changes: 11 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,14 @@ source_file = conf/locale/en/LC_MESSAGES/wiki.po
source_lang = en
type = PO

[o:open-edx:p:open-edx-releases:r:release-nutmeg]
file_filter = conf/locale/<lang>/LC_MESSAGES/django.po
source_file = conf/locale/en/LC_MESSAGES/django.po
source_lang = en
type = PO

[o:open-edx:p:open-edx-releases:r:release-nutmeg-js]
file_filter = conf/locale/<lang>/LC_MESSAGES/djangojs.po
source_file = conf/locale/en/LC_MESSAGES/djangojs.po
source_lang = en
type = PO
26 changes: 26 additions & 0 deletions cms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
isort:skip_file
"""

# FAL-2248: Monkey patch django's get_storage_engine to work around long migrations times.
# This fixes a performance issue with database migrations in Ocim. We will need to keep
# this patch in our opencraft-release/* branches until edx-platform upgrades to Django 4.*
# which will include this commit:
# https://github.com/django/django/commit/518ce7a51f994fc0585d31c4553e2072bf816f76
import django.db.backends.mysql.introspection

# We monkey patch Kombu's entrypoints listing because scanning through this
# accounts for the majority of LMS/Studio startup time for tests, and we don't
Expand All @@ -22,3 +28,23 @@
# that shared_task will use this app, and also ensures that the celery
# singleton is always configured for the CMS.
from .celery import APP as CELERY_APP # lint-amnesty, pylint: disable=wrong-import-position


def get_storage_engine(self, cursor, table_name):
"""
This is a patched version of `get_storage_engine` that fixes a
performance issue with migrations. For more info see FAL-2248 and
https://github.com/django/django/pull/14766
"""
cursor.execute("""
SELECT engine
FROM information_schema.tables
WHERE table_name = %s
AND table_schema = DATABASE()""", [table_name])
result = cursor.fetchone()
if not result:
return self.connection.features._mysql_storage_engine # pylint: disable=protected-access
return result[0]


django.db.backends.mysql.introspection.DatabaseIntrospection.get_storage_engine = get_storage_engine
13 changes: 12 additions & 1 deletion cms/djangoapps/contentstore/config/waffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"""


from edx_toggles.toggles import LegacyWaffleFlag, LegacyWaffleFlagNamespace, LegacyWaffleSwitchNamespace
from edx_toggles.toggles import LegacyWaffleFlag, LegacyWaffleFlagNamespace, LegacyWaffleSwitchNamespace, WaffleFlag

from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag

# Namespace
WAFFLE_NAMESPACE = 'studio'
LOG_PREFIX = 'Studio: '

# Switches
# TODO: Replace with WaffleSwitch(). See waffle() docstring.
Expand Down Expand Up @@ -81,3 +82,13 @@ def waffle_flags():
# .. toggle_warnings: Flag course_experience.relative_dates should also be active for relative dates functionalities to work.
# .. toggle_tickets: https://openedx.atlassian.net/browse/AA-844
CUSTOM_RELATIVE_DATES = CourseWaffleFlag(WAFFLE_NAMESPACE, 'custom_relative_dates', module_name=__name__,)

# .. toggle_name: studio.prevent_staff_structure_deletion
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Prevents staff from deleting course structures
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2021-06-25
PREVENT_STAFF_STRUCTURE_DELETION = WaffleFlag(
f'{WAFFLE_NAMESPACE}.prevent_staff_structure_deletion', __name__, LOG_PREFIX
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

from cms.djangoapps.contentstore.models import BackfillCourseTabsConfig

from openedx.core.djangoapps.content.course_overviews.models import CourseOverview

logger = logging.getLogger(__name__)


Expand All @@ -29,9 +31,13 @@ class Command(BaseCommand):
help = (
'Backfill default course tabs for all courses. This command is essentially for when a new default '
'tab is added and we need to update all existing courses. Any new courses will pick up the new '
'tab automatically via course creation and the CourseTabList.initialize_default method.'
'tab automatically via course creation and the CourseTabList.initialize_default method. '
'Can pass an optional flag --no-publish to skip publishing the courses.'
)

def add_arguments(self, parser):
parser.add_argument('--no-publish', action='store_true', help="Skip publishing courses")

def handle(self, *args, **options):
"""
Gathers all course keys in the modulestore and updates the course tabs
Expand Down Expand Up @@ -59,10 +65,15 @@ def handle(self, *args, **options):
new_tabs = {tab.type for tab in course.tabs}

if existing_tabs != new_tabs:
# This will trigger the Course Published Signal which is necessary to update
# the corresponding Course Overview
logger.info(f'Updating tabs for {course_key}.')
store.update_item(course, ModuleStoreEnum.UserID.mgmt_command)
if options['no_publish']:
# This will update the course block and overview without
# triggering course published signal
store.update_item(course, ModuleStoreEnum.UserID.mgmt_command, no_signals=True)
CourseOverview.load_from_module_store(course.id)
else:
# This will trigger the Course Published Signal
store.update_item(course, ModuleStoreEnum.UserID.mgmt_command)
logger.info(f'Successfully updated tabs for {course_key}.')
except Exception as err: # pylint: disable=broad-except
logger.exception(err)
Expand Down
10 changes: 10 additions & 0 deletions cms/djangoapps/contentstore/permissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
Permission definitions for the contentstore djangoapp
"""

from bridgekeeper import perms

from lms.djangoapps.courseware.rules import HasRolesRule

DELETE_COURSE_CONTENT = 'contentstore.delete_course_content'
perms[DELETE_COURSE_CONTENT] = HasRolesRule('instructor')
2 changes: 2 additions & 0 deletions cms/djangoapps/contentstore/views/certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ def serialize_certificate(certificate):
# Some keys are not required, such as the title override...
if certificate_data.get('course_title'):
certificate_response["course_title"] = certificate_data['course_title']
if certificate_data.get('course_description'):
certificate_response['course_description'] = certificate_data['course_description']

return certificate_response

Expand Down
5 changes: 5 additions & 0 deletions cms/djangoapps/contentstore/views/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,11 @@ def component_handler(request, usage_key_string, handler, suffix=''):
"""
usage_key = UsageKey.from_string(usage_key_string)

# Addendum:
# TNL 101-62 studio write permission is also checked for editing content.

if handler == 'submit_studio_edits' and not has_course_author_access(request.user, usage_key.course_key):
raise PermissionDenied("No studio write Permissions")
# Let the module handle the AJAX
req = django_to_webob_request(request)

Expand Down
15 changes: 15 additions & 0 deletions cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
from openedx.core.djangoapps.credit.tasks import update_credit_course_requirements
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api.models import UserPreference
from openedx.core.djangolib.js_utils import dump_js_escaped_json
from openedx.core.lib.course_tabs import CourseTabPluginManager
from openedx.core.lib.courses import course_image_url
Expand Down Expand Up @@ -1156,6 +1157,13 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
verified_mode = CourseMode.verified_mode_for_course(course_key, include_expired=True)
upgrade_deadline = (verified_mode and verified_mode.expiration_datetime and
verified_mode.expiration_datetime.isoformat())

date_placeholder_format = configuration_helpers.get_value_for_org(
course_module.location.org,
'SCHEDULE_DETAIL_FORMAT',
settings.SCHEDULE_DETAIL_FORMAT
).upper()

settings_context = {
'context_course': course_module,
'course_locator': course_key,
Expand All @@ -1180,6 +1188,7 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
'enable_extended_course_details': enable_extended_course_details,
'upgrade_deadline': upgrade_deadline,
'mfe_proctored_exam_settings_url': get_proctored_exam_settings_url(course_module.id),
'date_placeholder_format': date_placeholder_format,
}
if is_prerequisite_courses_enabled():
courses, in_process_course_actions = get_courses_accessible_to_user(request)
Expand Down Expand Up @@ -1214,6 +1223,12 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
elif 'application/json' in request.META.get('HTTP_ACCEPT', ''):
if request.method == 'GET':
course_details = CourseDetails.fetch(course_key)

# Fetch the prefered timezone setup by the user
# and pass it as part of Json response
user_timezone = UserPreference.get_value(request.user, 'time_zone')
course_details.user_timezone = user_timezone

return JsonResponse(
course_details,
# encoder serializes dates, old locations, and instances
Expand Down
Loading