From 629a8e7ed529fc81434781066077a9668210eab9 Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Mon, 3 Sep 2012 23:04:30 -0700 Subject: [PATCH] allowing for 0 top level topics --- lms/djangoapps/django_comment_client/utils.py | 2 +- lms/static/coffee/src/discussion/views/new_post_view.coffee | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index fd3458bfd0..373611380d 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -120,7 +120,7 @@ def initialize_discussion_info(course): node[level]["entries"][entry["title"]] = {"id": entry["id"], "sort_key": entry["sort_key"]} - for topic, entry in course.metadata['discussion_topics'].items(): + for topic, entry in course.metadata.get('discussion_topics', {}).items(): category_map['entries'][topic] = {"id": entry["id"], "sort_key": entry.get("sort_key", topic)} diff --git a/lms/static/coffee/src/discussion/views/new_post_view.coffee b/lms/static/coffee/src/discussion/views/new_post_view.coffee index 24210f13ab..fea87e4657 100644 --- a/lms/static/coffee/src/discussion/views/new_post_view.coffee +++ b/lms/static/coffee/src/discussion/views/new_post_view.coffee @@ -42,7 +42,6 @@ class @NewPostView extends Backbone.View # change and 2) can't set in initialize because the button is hidden @maxNameWidth = @dropdownButton.width() * 0.9 - # Need a fat arrow because hideTopicDropdown is passed as a callback to bind hideTopicDropdown: () => @menuOpen = false