From 3762efd2ec9dccf31a8f4808e987fa7590a84086 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 20 Aug 2012 16:34:13 -0400 Subject: [PATCH 1/8] added pystache dependency --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index f560110bcc..a57c1f8fae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -44,6 +44,7 @@ django-ses django-storages django-threaded-multihost django-sekizai<0.7 +pystache -e git://github.com/benjaoming/django-wiki.git@c145596#egg=django-wiki -e git://github.com/dementrock/pystache_custom.git#egg=pystache_custom -r repo-requirements.txt From 47bf5160010d0975297d39b200492270a5279e81 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 20 Aug 2012 16:48:31 -0400 Subject: [PATCH 2/8] Remove unnecessary import that was failing a test --- common/lib/xmodule/xmodule/discussion_module.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/discussion_module.py b/common/lib/xmodule/xmodule/discussion_module.py index a92b112ef1..c029d95098 100644 --- a/common/lib/xmodule/xmodule/discussion_module.py +++ b/common/lib/xmodule/xmodule/discussion_module.py @@ -3,8 +3,6 @@ from lxml import etree from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor -import comment_client - import json class DiscussionModule(XModule): From b6dfa50a73602c71c0583807eb1e1504155f839a Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 20 Aug 2012 17:33:45 -0400 Subject: [PATCH 3/8] Adjust settings so we can change the comments service URL from Django config --- lms/envs/aws.py | 2 ++ lms/lib/comment_client/settings.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lms/envs/aws.py b/lms/envs/aws.py index d2d71830b0..5480346b08 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -60,3 +60,5 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE'] if 'COURSE_ID' in ENV_TOKENS: ASKBOT_URL = "courses/{0}/discussions/".format(ENV_TOKENS['COURSE_ID']) +COMMENTS_SERVICE_URL = ENV_TOKENS["COMMENTS_SERVICE_URL"] + diff --git a/lms/lib/comment_client/settings.py b/lms/lib/comment_client/settings.py index df896204ce..f64726335f 100644 --- a/lms/lib/comment_client/settings.py +++ b/lms/lib/comment_client/settings.py @@ -1,3 +1,8 @@ -SERVICE_HOST = 'http://localhost:4567' +from django.conf import settings + +if hasattr(settings, "COMMENTS_SERVICE_URL"): + SERVICE_HOST = settings.COMMENTS_SERVICE_URL +else: + SERVICE_HOST = 'http://localhost:4567' PREFIX = SERVICE_HOST + '/api/v1' From 8ab98d33eaa20d25f472e9b5f3039ef5e43b2356 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 20 Aug 2012 18:02:32 -0400 Subject: [PATCH 4/8] remove pystache dependency --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a57c1f8fae..f560110bcc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -44,7 +44,6 @@ django-ses django-storages django-threaded-multihost django-sekizai<0.7 -pystache -e git://github.com/benjaoming/django-wiki.git@c145596#egg=django-wiki -e git://github.com/dementrock/pystache_custom.git#egg=pystache_custom -r repo-requirements.txt From 1ebc810ae55c3a695c6ba02e146ba563a9199042 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 20 Aug 2012 19:16:21 -0400 Subject: [PATCH 5/8] Fix some links taht were still pointing to the old courseware course_navigation pages. --- lms/templates/discussion/index.html | 2 +- lms/templates/discussion/user_profile.html | 2 +- lms/templates/news.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lms/templates/discussion/index.html b/lms/templates/discussion/index.html index f34152c569..9b0494dfff 100644 --- a/lms/templates/discussion/index.html +++ b/lms/templates/discussion/index.html @@ -11,7 +11,7 @@ <%include file="_js_dependencies.html" /> -<%include file="../course_navigation.html" args="active_page='discussion'" /> +<%include file="/courseware/course_navigation.html" args="active_page='discussion'" />
diff --git a/lms/templates/discussion/user_profile.html b/lms/templates/discussion/user_profile.html index 3825879c3b..c4d0d85607 100644 --- a/lms/templates/discussion/user_profile.html +++ b/lms/templates/discussion/user_profile.html @@ -14,7 +14,7 @@ <%include file="_js_dependencies.html" /> -<%include file="../course_navigation.html" args="active_page='discussion'" /> +<%include file="/courseware/course_navigation.html" args="active_page='discussion'" />
diff --git a/lms/templates/news.html b/lms/templates/news.html index 63724759a5..2c37975e2a 100644 --- a/lms/templates/news.html +++ b/lms/templates/news.html @@ -10,7 +10,7 @@ <%block name="js_extra"> -<%include file="course_navigation.html" args="active_page='news'" /> +<%include file="/courseware/course_navigation.html" args="active_page='news'" />
From 66a9512e5792d0bc6ccc7ab192dcf216a3215fc1 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 20 Aug 2012 19:30:45 -0400 Subject: [PATCH 6/8] disable askbot and enable berkeley forum in AWS config --- lms/envs/aws.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 5480346b08..059254bdff 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -19,6 +19,11 @@ EMAIL_BACKEND = 'django_ses.SESBackend' SESSION_ENGINE = 'django.contrib.sessions.backends.cache' DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' +# Disable askbot, enable Berkeley forums +MITX_FEATURES['ENABLE_DISCUSSION'] = False +MITX_FEATURES['ENABLE_DISCUSSION_SERVICE'] = True + + ########################### NON-SECURE ENV CONFIG ############################## # Things like server locations, ports, etc. with open(ENV_ROOT / "env.json") as env_file: From c3718e49b6e4fe679e4939182ab546f7b12c2bf8 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 20 Aug 2012 20:15:07 -0400 Subject: [PATCH 7/8] Meaningless commit to force build --- install.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/install.txt b/install.txt index fa82b11a5c..37a6e50986 100644 --- a/install.txt +++ b/install.txt @@ -74,5 +74,4 @@ There is also a script "create-dev-env.sh" that automates these steps. $ django-admin.py syncdb --settings=envs.dev --pythonpath=. $ django-admin.py migrate --settings=envs.dev --pythonpath=. $ django-admin.py runserver --settings=envs.dev --pythonpath=. - From bca6699b58da9a1d53b30a47552f513b30ae9f04 Mon Sep 17 00:00:00 2001 From: Rocky Duan Date: Mon, 20 Aug 2012 22:37:26 -0700 Subject: [PATCH 8/8] updated seed_permissions_and_roles to accept course_id as a parameter --- .../management/commands/seed_permissions_roles.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/django_comment_client/management/commands/seed_permissions_roles.py b/lms/djangoapps/django_comment_client/management/commands/seed_permissions_roles.py index 8ce0cf49d3..5987d5c677 100644 --- a/lms/djangoapps/django_comment_client/management/commands/seed_permissions_roles.py +++ b/lms/djangoapps/django_comment_client/management/commands/seed_permissions_roles.py @@ -3,13 +3,16 @@ from django_comment_client.models import Permission, Role class Command(BaseCommand): - args = '' + args = 'course_id' help = 'Seed default permisssions and roles' def handle(self, *args, **options): - administrator_role = Role.objects.get_or_create(name="Administrator", course_id="MITx/6.002x/2012_Fall")[0] - moderator_role = Role.objects.get_or_create(name="Moderator", course_id="MITx/6.002x/2012_Fall")[0] - student_role = Role.objects.get_or_create(name="Student", course_id="MITx/6.002x/2012_Fall")[0] + if len(args) != 1: + raise CommandError("The number of arguments does not match. ") + course_id = args[0] + administrator_role = Role.objects.get_or_create(name="Administrator", course_id=course_id)[0] + moderator_role = Role.objects.get_or_create(name="Moderator", course_id=course_id)[0] + student_role = Role.objects.get_or_create(name="Student", course_id=course_id)[0] for per in ["vote", "update_thread", "follow_thread", "unfollow_thread", "update_comment", "create_sub_comment", "unvote" , "create_thread",