From 2a39a45a74d31bcf06bdac8f6cbac06779efdcd2 Mon Sep 17 00:00:00 2001 From: awais qureshi Date: Thu, 12 Dec 2024 15:42:47 +0500 Subject: [PATCH] feat: Adding course templates functionality. --- cms/djangoapps/contentstore/views/import_export.py | 4 +++- cms/templates/widgets/header.html | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/views/import_export.py b/cms/djangoapps/contentstore/views/import_export.py index 72aac86042fa..c504116eaece 100644 --- a/cms/djangoapps/contentstore/views/import_export.py +++ b/cms/djangoapps/contentstore/views/import_export.py @@ -9,6 +9,7 @@ import logging import os import re +import requests import shutil from wsgiref.util import FileWrapper @@ -25,6 +26,7 @@ from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.http import require_GET, require_http_methods from django.shortcuts import render +from django.urls import reverse from edx_django_utils.monitoring import set_custom_attribute, set_custom_attributes_for_course_key from opaque_keys.edx.keys import CourseKey @@ -474,7 +476,7 @@ def course_templates(request, course_key_string): courselike_key = CourseKey.from_string(course_key_string) organization = courselike_key.org successful_url = f"http://localhost:18010/api/contentstore/v1/course_templates/{course_key_string}" - import requests + courses = [] resp = requests.get(successful_url) if resp.status_code == 200: diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 8b14398fc378..fd2a9d27a4f3 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -252,6 +252,9 @@

${_("Tools")} ${_("Export to Git")} % endif +